How to Restart Your Linux Server (3 Easy Methods)

Instead of skipping to how to restart your Linux server, read the entirety of the guide 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:

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. You may already know not to halt a system during an SSH connection with activity. Whatever you’re doing in the server terminal will end abruptly unless you started the process with screen or tmux. Here are other specific cases where you DO NOT want to restart your server immediately, and what you should do instead.

Your Website or Email Doesn’t Work Correctly

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:

  • Your website loads properly on another device and for other countries with web apps like GeoPeeker and ShotSherpa
  • Your hosting provider has noted outage issues
  • You’re receiving a lot of orders from your eCommerce store
  • Your web analytics application or social media indicates posts that may be viral
  • Error logs indicate database, misconfiguration, denial of service (DoS), or other malicious issues

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

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.

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.

InMotion Hosting Contributor
InMotion Hosting Contributor Content Writer

InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!

More Articles by InMotion Hosting

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

  1. 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?

     

    1. 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

    1. 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? Join the conversation!