keepcalculator

06 Numbers and Powers

How to Restart a VPS After Running Shutdown -h Now

Card No. 06·40349 · Updated · Standard formula, shown below

Running shutdown -h now on a VPS immediately powers it down, which can leave you locked out if you didn’t plan a restart. This guide explains how to bring your VPS back online using your hosting provider’s control panel, the command line (if you still have access), or a recovery console. You’ll learn the exact steps to reboot safely and avoid common pitfalls.

What You’ll Need

  • Access to your VPS hosting provider’s web-based control panel (e.g., Vultr, DigitalOcean, Linode, AWS, or your provider’s custom panel).
  • Your VPS login credentials (username and password or SSH key) for after the restart.
  • If you plan to use the command line, an active SSH session that is still connected (unlikely after a shutdown, but possible if you have a serial console).

Step-by-Step

  1. Log in to your hosting provider’s control panel. Open a web browser and go to your provider’s dashboard. This is the same place where you created the VPS or manage billing.
  2. Locate your VPS instance. In the dashboard, find the list of your servers or instances. Click on the name or the “Manage” button for the VPS you shut down.
  3. Find the power or reboot controls. Look for buttons labeled “Power”, “Reboot”, “Start”, or a power icon. On most panels, these are at the top of the instance page or in a sidebar.
  4. Start the VPS (if it’s fully powered off). Since you ran shutdown -h now, the VPS is in a stopped state. Click the “Start” or “Power On” button. Confirm any dialog that asks if you’re sure.
  5. If you only see a “Reboot” button, use it. Some panels automatically restart a stopped instance when you click “Reboot”. If the status shows “Stopped”, “Powered Off”, or “Offline”, the “Reboot” button may still work—it sends a power-on signal.
  6. Wait for the VPS to boot. The status will change to “Starting” or “Running” within a few seconds to a minute. Refresh the page if needed.
  7. Verify the VPS is back online. Once the status shows “Running”, try to connect via SSH: ssh user@your-server-ip. If that fails, wait another 30 seconds and try again—the OS may still be finishing boot.
  8. If you still have an active SSH session (e.g., via a serial console), you can reboot from the command line. Type sudo reboot or sudo shutdown -r now. This is only possible if the system hasn’t fully powered off yet or if you have a console that stays connected.
  9. Use a recovery console if the VPS doesn’t come back. Most providers offer a “Console” or “VNC” option in the panel. Open it to see the boot process and any errors. You may need to press a key to interrupt the boot and edit kernel parameters, but for a simple restart, just let it boot normally.

Common Mistakes

  • Clicking “Shutdown” instead of “Reboot” in the panel. This will keep the VPS off. Always read the button label.
  • Waiting too long before trying to reconnect. After the panel shows “Running”, give the OS 30-60 seconds to finish booting before SSH. Trying too early may show “Connection refused”.
  • Assuming the VPS auto-restarts. A shutdown -h now halts the system. Unless your provider has a “restart on crash” policy (which is not guaranteed), it will stay off until you manually start it.
  • Forgetting to check the provider’s status page. If the panel doesn’t respond, there may be a broader outage. Check the provider’s status page before assuming you did something wrong.

Tips

  • Use shutdown -r now for restarts. If you intend to reboot, use -r instead of -h. This avoids the need to manually start the VPS.
  • Schedule maintenance windows. If you need to reboot, do it during low-traffic hours. You can use shutdown -r +5 to delay the reboot by 5 minutes, giving you time to close sessions.
  • Set up a startup script. If your VPS runs critical services, consider a systemd service that starts them on boot. This ensures they come back automatically after a restart.
  • Keep your provider’s mobile app handy. Many providers have apps that let you start/stop/reboot from your phone, which is useful if you’re away from a computer.
  • Test your backup/restore process. If you ever need to rebuild the VPS from scratch, knowing how to restore from a snapshot will save time.

Troubleshooting

VPS won’t start after clicking “Start”. First, wait a few minutes—some providers take longer. If it still shows “Stopped”, try clicking “Start” again. If that fails, check if you have any outstanding invoices or if the VPS was suspended. Contact support if the issue persists.

SSH connection refused after the VPS is “Running”. This usually means the OS is still booting or the SSH service didn’t start. Wait 30-60 seconds and try again. If it still fails, open the console in the panel to see if there’s a login prompt. If there’s a kernel panic or filesystem error, you may need to boot into recovery mode (see below).

The console shows a black screen or is unresponsive. Try clicking “Send CtrlAltDel” or “Reboot” from the console menu. If the VPS is completely frozen, you may need to force a power cycle using the panel’s “Force Restart” option (if available).

You can’t access the control panel at all. This could be a provider outage. Check their status page or Twitter. If the panel is down, you may have to wait—there’s no other way to power on a VPS that’s off.

After boot, services are not running. Check the service status with systemctl status service-name. If they are disabled, enable them with systemctl enable service-name so they start on boot.

Frequently Asked Questions

Can I restart a VPS without the control panel?

Only if you have an active SSH session or a serial console that is still connected. If the VPS is fully powered off, you must use the provider’s panel—there is no way to send a magic packet over the internet to a powered-down machine.

What’s the difference between shutdown -h now and shutdown -r now?

-h halts the system (powers off), while -r reboots it. After -h, the VPS stays off until you manually start it; after -r, it comes back automatically.

Will my data be lost after a shutdown?

No. A clean shutdown (like shutdown -h now) flushes filesystems and stops processes gracefully, so your data remains intact. However, if the VPS is force-stopped (e.g., by pulling the plug), there’s a small risk of data corruption.

How long does it take for a VPS to boot?

Typically 30-90 seconds, depending on the OS and hardware. Some providers show “Running” before the OS is fully ready, so wait a bit before trying SSH.

What if I accidentally shut down the VPS and I’m not the admin?

If you have access to the control panel, you can start it. If not, contact the person who owns the account or your hosting provider’s support with proof of ownership.

Is there a way to prevent accidental shutdowns?

Yes. Use sudo shutdown -r now for restarts, and avoid running shutdown as root without double-checking the flags. You can also set up a cron job to automatically start services after boot, but that won’t prevent the shutdown itself.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →