How to Shutdown Ubuntu Server

We can use either shutdown or poweroff command to shutdown Ubuntu
Server from the terminal.

The Ubuntu shutdown command requires a time parameter while poweroff command will power off the server immediately.

shutdown command

The Ubuntu shutdown command should use with -P(Capital P) Option and require timer(when to poweroff).

shutdown -P timer

We can power off the Ubuntu server immediately by Passing now as the timer. If we want we can add time delay to Ubuntu shutdown command with either +minutes or hh:mm format as a timer.

Examples

shutdown -P now

This will shutdown your Ubuntu server immediately.

shutdown +3min

Ubuntu Server Will be poweroff in three minutes.

Sponsored

shutdown 12:20

Sponsored

Server will be poweroff at 12.20 PM

You can press CTRL + C on keyboard to Cancel a pending shutdown

Example

As Above screenshot shows, Fist I issued the Ubuntu shutdown command to power off the Ubuntu server after Five minutes. But then I decide to cancel it by pressing the CTRL + C on the keyboard.

shutdown command in Ubuntu Linux needs root privileges , So either you need to be the root user or you should be a administrative user who can run commands with sudo.

Poweroff command

poweroff command in Ubuntu Linux does not have a timer option. So the server will stop immediately after you type the poweroff command in the Ubuntu terminal.

Telinit command

Telinit command in ubuntu use to change the runlevel and since the runlevel 0 is halt means, if we change the runlevel to 0 using telinit command server will be powered off.

telinit 0

In a Live System i would recommend to use the shutdown command with time delay instead of poweroff and telinit command, because you can cancel the pending shutdown if you want.

Ubuntu Server Admin

Recent Posts

Kolla Ansible OpenStack Installation (Ubuntu 24.04)

Kolla Ansible provides production-ready containers (here, Docker) and deployment tools for operating OpenStack clouds. This…

5 hours ago

Canonical announces first Ubuntu Desktop image for Qualcomm Dragonwing™ Platform with Ubuntu 24.04

This public beta enables the full Ubuntu Desktop experience on the Qualcomm Dragonwing™ QCS6490 and…

1 day ago

The long march towards delivering CRA compliance

Time is running out to be in full compliance with the EU Cyber Resilience Act,…

1 day ago

Extra Factor Authentication: how to create zero trust IAM with third-party IdPs

Identity management is vitally important in cybersecurity. Every time someone tries to access your networks,…

2 days ago

Ubuntu Weekly Newsletter Issue 889

Welcome to the Ubuntu Weekly Newsletter, Issue 889 for the week of April 20 –…

4 days ago

From pidfd to Shimanami Kaido: My RubyKaigi 2025 Experience

Introduction I just returned from RubyKaigi 2025, which ran from April 16th to 18th at…

4 days ago