How to Restart Your Linux Server (3 Easy Methods)

Instead of skipping to how to restart your Linux server, please read on for better understanding of the pros and cons. 

A demonstration on how to restart your Linux server in WHM and AMP

When a PC slows down, we all know restarting it as a quick solution. This is good enough for users who don’t audit system logs to investigate the matter. Usually, the best solution is to investigate running processes and better secure the system. With server hosting, this is especially important because it’s always online and you can’t disconnect it from the internet to work on it locally. Logs are your best friend during incident response procedures after a cyber attack.

Managed VPS, Cloud Server, and Dedicated Server hosting customers have the option to restart their Linux server in multiple ways. There are times when this is necessary. It shouldn’t be often, though. Below we’ll cover:

Let our Managed Hosting team configure your servers while you work on building your brand!

When Should You Not Restart a Linux Server?

When a server is in use, there are always disk writes to a database, server log, or application. Here are specific cases where you DO NOT want to restart your server immediately, and what you should do instead.

Your Website is Loading Slowly or Not at All

Each popular content management system (CMS) has common errors, hopefully with well documented solutions. Performance demands climb every year with new technologies like HTTP/3 and NVMe drives. And of course, cyber attacks are always on the rise. Any of these situations can affect website and server performance. Instead of restarting your server, check if:

If this is a constant issue, consider one or more of the following:

  • Caching integrations for your CMS (e.g. W3TC WordPress plugin and Drupal native caching options)
  • Server caching (e.g. NGINX)
  • A content delivery network (CDN) and web application firewall (WAF) solution such as Cloudflare and Sucuri
No matter if you’re a developer, system administrator, or simply a fan of SSH and command line, InMotion’s Cloud VPS plans provide a fast, scalable environment that is budget-friendly.

Your Email Doesn’t Work for You or Others

When you have email issues, usually you receive some type of bounceback error. Restarting the server won’t fix those errors.

Check your email client settings if you can’t send email.

Check local firewall settings if you can’t send email while using a virtual private network (VPN).

If your emails deliver to spam / junk folders, improve your email authentication settings.

You Installed Something

Many installation guides for server level software instruct you to “restart your VPS” at some point. Popular examples include Apache modules, new PHP versions, and SSH port changes. Most times, you only need to restart the web server application.

Apache:

systemctl restart apache2

NGINX:

systemctl nginx restart

WebHost Manager (WHM) can do this as well under Restart Services.

You Have an SSH Connection to the Server

Whatever you’re doing in the server terminal will end abruptly unless you started the process with screen or tmux.

The Server Hasn’t Been Restarted in Awhile

Going back to restarting PCs, Linux servers normally have log optimization methods already in place to save disk space. Usually, it’s compressing older logs in tar files and deleting them after a certain amount of time.

When Should I Stop or Restart a Linux Server?

The most common situations when you DO want to restart your server:

Critical Updates

Some major update, installation, and uninstallation processes require rebooting the server. Read the instructions carefully to ensure it states to restart the server instead of just the web server application.

Test Server Restart Feature

You should be sure that all installed applications will start without issue after a reboot. You don’t know when you or your hosting provider may need to apply critical updates which require a reboot while you’re sleeping. 

For VPS administrators, if your hosting provider starts disaster recovery procedures for their cloud infrastructure, your virtual server may be restarted as part of a node. Remember, a VPS or cloud server (cloud VPS) shares a physical server with other customers. In some instances, you may have a temporary issue due to something outside of your control.

Save Money with a Virtual Private Cloud (VPC)

Unlike a VPS, a virtual private cloud (VPC) can expand to meet peaking resource demands and is pay-per-usage in seconds/hours online instead of a monthly subscription. If you don’t need your VPC on, shut it off. But ensure installed applications will start correctly before doing so.

How to Restart a Linux Server

Managed VPS, Cloud Server, and Dedicated Server hosting customers can restart your Linux server in AMP, WHM, or SSH. Remember, rebooting the server restarts Apache, MySQL, and email as well.

You can’t restart a shared server because you don’t have a virtual system and root access. You have a cPanel account on a shared physical server. Shared servers rarely need to be restarted unless our system administrators see an issue requiring it. If you have website issues which you believe result from the server, contact technical support for further assistance.

How to Restart Your VPS in AMP

You do not need root access for this.

  1. Log into AMP.
  2. Locate the server hosting account and select Restart VPS.
  3. Read the warnings. If you’re sure, select Restart VPS.
AMP VPS Restart services click details
Click the button to read the warnings

How to Restart Your Linux Server in WHM

You may need root access for this, depending on your cPanel user privileges in WHM.

  1. Log into WHM.
  2. On the left under System Reboot, select Graceful Server Reboot or Forceful Server Reboot. Use the graceful method because it prompts cPanel to finish user-level processes and not start anything new, preventing data corruption. The forceful method is the hard reset option you should only use if the graceful option doesn’t work.

You can restart individual services in WHM under Restart Services.

Restart Linux Services in WHM
Restart services in WHM

How to Restart Your Linux Server via SSH

You will need root access to execute the following commands in SSH or WHM Terminal.

It’s generally best to use AMP or WHM to do this on cPanel servers to prevent data loss.

Restart your server:

shutdown -r now
shutdown -r 0
reboot

Shutdown your server:

shutdown
halt
poweroff

Learn more about managing your Linux server hosting from our VPS Hosting Product Guide.

J
Jacqueem Technical Writer

Technical writer focused on cybersecurity and musicianship.

More Articles by Jacqueem

Thoughts on “How to Restart Your Linux Server (3 Easy Methods)

  • https://example.com/journals/index.php/jisct/article/download/161/117. After migration I am not able to access pdf file. I am using OJS script. Will you help me?

     

    • Hello Kawaljit,

      Thank you for contacting us. I tested the link you provided, and the pdf file downloaded successfully for me at this time.

      Are you still experiencing issues with downloading this pdf file?

      Thank you,
      John-Paul

    • Hello JOSEPH,

      Thank you for your question. First, I recommend following our Outlook Setup guide. This should allow you to check your email.

      If you have already set your email up successfully, and it just stopped displaying email, restarting Outlook may help.

      I you have any further questions, feel free to post them below.

      Thank you,
      John-Paul

Was this article helpful? Let us know!