FreeBSD or BSD reboot and shutdown system

I am a new FreeBSD server user. How do I reboot or shutdown a FreeBSD based system? I tried shutdown -h 0 command. However, is not working for me on my BSD based system. How can I shutdown or reboot the server?

FreeBSD or other BSD families of operating systems use the shutdown or halt command to shutdown system. Use the reboot command to reboot the FreeBSD based system.

Shutdown FreeBSD command

Use the shutdown commandto close down the system at a given time. Type following command to shutdown system immediately. You must login as root user:
$ su -
$ sudo -i
Now shutdown the system at a given time:
# shutdown -h now
# halt
The -h option passed to halt the system. The time is the time at which shutdown ill bring the BSD system down and may be the case-insensitive word now (indicating an immediate shutdown) or a future time in one of two formats:

  1. +number – The first form brings the system down in number minutes and the second at the absolute time specified. +number may be specified in units other than minutes by appending the corresponding suffix: s/sec, m/min, and h/hour.
  2. yymmddhhmm - Where the year, month,and day may be defaulted to the current system values.

Halt the FreeBSD system in 10 minutes and show a warning message:
# shutdown -h +10 "System will shutdown for motherboard replacement."

Reboot BSD system

Type the following command as superuser/root user:
# reboot
# shutdown -r now
The -r option to reboot the system at the specified time. Again you can specify time using the +number or yymmddhhmm format.

FreeBSD reboot the system

Say you want to reboot in 60 minutes and also need to display a warning message for all users currently logged in via ssh or other terminals. Therefore, try the following syntax:
# shutdown -r +60 "System will reboot for system ram upgrades."

shutdown command options for FreeBSD

  1. -h - The BSD system is halted at the specified time.
  2. -p - The FreeBSD system is shutodwn and the power is turned off (hardware support required) at the specified time.
  3. -r - The system is rebooted at the specified time.
  4. -k - Kick everybody off. The -k option does not actually halt the system, but leaves the system multi-user with logins disabled (for all but super-user).
  5. -o - If one of the -h, -p or -r options are specified, shutdown will execute halt(8) or reboot(8) instead of sending a signal to init(8).
  6. -n - If the -o option is specified, prevent the file system cache from being flushed by passing -n to halt(8) or reboot(8). This option should probably not be used.

Getting help on shutdown command

Simply type the following man command man shutdown
man halt
man reboot

A note about Permission denied and other error messages

You will get an error message that read as "permission denied" or "operation not permitted" on FreeBSD. To avoid these error messages always run shutdown and reboot command as the root user:
FreeBSD shutdown and reboot command

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • bipolor Oct 13, 2008 @ 6:16

    When I did it closes all the programs and just hangs and say press the space bar to restart?

    Is there a more powerfull command that can shutdown the system right away?

  • fkrahe Mar 13, 2009 @ 21:34


    Are you root?

  • wycito Mar 20, 2009 @ 3:49

    Yes I am root in my case and the computer stays on and with the press enter to reboot, what if I (to conserve energy) just want to shut it off for good…

  • moo Mar 31, 2009 @ 23:46

    “To power down a FreeBSD machine on architectures and systems that support power management, simply use the command shutdown -p now to turn the power off immediately.”

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum