To shutdown Ubuntu server immediately, you can use the shutdown command like this:
sudo shutdown now
Yes. You need to be a sudo user or root to shut down a Linux server because it is an administrative task.
Some people prefer to use
shutdown -h now but that's not required as both refer to power-off.
Keep in mind that you must have a way to power it on back again otherwise prefer to reboot remote servers.
How to shutdown Ubuntu server
Linux shutdown command is not the only way to shut down Ubuntu or other Linux from the terminal. There are other commands that can be used to shutdown Linux from the shell.
But first let's take another look at it this command.
1. Poweroff Ubuntu using shutdown command
You can use the shutdown command without any options. This will schedule a shutdown a minute from your current time.
You can cancel the scheduled shutdown with option
sudo shutdown -c
No message is displayed when the shutdown is cancelled.
Here's a screenshot of what it looks using the above commands. I have used Debian server in the image below but it should be the same for Ubuntu as well.
2. Shutdown Ubuntu using systemd
You can use systemd command to shutdown i.e. power off an Ubuntu server or desktop.
sudo systemctl poweroff
3. Immediately shutdown Ubuntu server using poweroff
Can't wait for the shut down? You always have the shutdown now for that. Another way to shut down immediately is by using the poweroff command:
I hope you found this quick Linux tip useful. Your comments and feedback is welcome.
Do subscribe to regularly receive Linux tips and tutorials for free.