---
title: "Restarting Services from the Command Line in Linux"
source: "https://docs.nexcess.com/hosting/server-administration/linux/restarting-services-from-the-command-line-in-linux/"
description: "To address issues or apply configuration changes, it's often necessary to restart specific server services, like Apache, Exim, FTP, or DNS. This typically invol…"
vertical: "Hosting"
date: "2024-03-04"
last_modified: "2026-08-13"
---

# Restarting Services from the Command Line in Linux

When you make changes on a server or are having problems, it’s common to have to restart certain services (such as Apache, Exim, FTP, and DNS). This could be because a service has crashed, because you’ve made configuration changes, or because of high server load.

[Build now](/hosting/hosting-services/cloud-vps/)

To restart services, you will need to [log into your server via SSH](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/). Restarting services usually requires root permissions or the [the use of sudo](https://www.liquidweb.com/help-docs/granting-a-user-sudo-permissions-in-linux/) (If the commands below don’t work, try adding *sudo* before the rest of the command). You might need to restart these services:

- [Apache](#Apache)
- [Mail](#Mail)
- [SSH](#SSH)
- [FTP](#FTP)
- [MySQL](#MySQL)
- [Firewall](#Firewall)
- [Cron](#Cron)
- [System Logging](#SysLog)

## Apache

Every time you make Apache configuration changes, you need to restart Apache. Apache’s service name is “httpd.” This is the name you’ll use to restart the service.

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart httpd.service
    ```
    
      
    and press **Enter**. If your server uses **CentOS, CloudLinux, or RHEL 5 or 6**, type:
    
      
    ```
    service httpd restart
    ```
    
      
    and press **Enter**.

That’s all! Apache will restart.

## Mail

Every time you make changes to your mail service, you need to restart the service. The mail service you have will depend on your server:

- [cPanel servers use Exim.](#Linux)
- [Plesk servers use Postfix.](#Plesk)

## Restarting Exim (cPanel Servers)

Exim’s service name is “exim.”

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart exim.service
    ```
    
      
    and press **Enter**. If your server uses **CentOS, CloudLinux, or RHEL 5 or 6**, type:
    
      
    ```
    service exim restart
    ```
    
      
    and press **Enter**.

That’s all! Exim will restart.

## Restarting Postfix (Plesk Servers)

Postfix’s service name is “postfix.”

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart postfix.service
    ```
    
      
    ```
    and press <strong>Enter</strong>. If your server uses <strong>CentOS, CloudLinux, or RHEL 5 or 6</strong>, type:<br></br>
    ```
    
      
    ```
    service postfix restart
    ```
    
      
    ```
    and press <strong>Enter</strong>.
    ```

That’s all! Postfix will restart.

## SSH

If you change SSH configuration, you’ll need to restart SSH. For example, changing SSH ports requires an SSH restart. The service name for SSH is “sshd.”

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart sshd.service
    ```
    
      
    and press **Enter**. If your server uses **CentOS, CloudLinux, or RHEL 5 or 6**, type:
    
      
    ```
    service sshd restart
    ```
    
      
    and press **Enter**.

That’s all! SSH will restart.

## FTP

The default FTP program is Pure FTP. The service name is “pure-ftp.” If you make any configuration changes, you’ll need to restart FTP.

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart pure-ftp.service
    ```
    
      
    ```
    and press <strong>Enter</strong>. If your server uses <strong>CentOS, CloudLinux, or RHEL 5 or 6</strong>, type:<br></br>
    ```
    
      
    ```
    service pure-ftp restart
    ```
    
      
    ```
    and press <strong>Enter</strong>.
    ```

That’s all! The FTP service will restart.

## MySQL

MySQL is called “mysql.”

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart mysql.service
    ```
    
      
    ```
    and press <strong>Enter</strong>. If your server uses <strong>CentOS, CloudLinux, or RHEL 5 or 6</strong>, type:<br></br>
    ```
    
      
    ```
    service mysql restart
    ```
    
      
    ```
    and press <strong>Enter</strong>.
    ```

That’s all! MySQL will restart.

## Firewall

The most common firewall you’ll have on your server is CSF. Every time you change CSF configurations, you need to reload the firewall rules. Reloading CSF rules is a little different from restarting other services.

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. In the command line prompt, type:  
    ```
    csf -r
    ```
    
      
    and press **Enter**.

That’s all you need to do! All the CSF rules will reload.

## Cron

The “cron” service controls scheduled server tasks.

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart cron.service
    ```
    
      
    and press **Enter**. If your server uses **CentOS, CloudLinux, or RHEL 5 or 6**, type:
    
      
    ```
    service cron restart
    ```
    
      
    and press **Enter**.

That’s all! Cron will restart.

## System Logging

Sometimes you’ll have to restart the service that handles all the system and kernel logging for your server. This service is called “syslog.”

1. Log into your server using the terminal program of your choice via SSH. If you haven’t done this before, read [Logging into Your Server via Secure Shell (SSH)](https://docs.nexcess.com/hosting/server-administration/linux/logging-into-your-server-via-secure-shell-ssh/) first.
2. If your server uses **CentOS, CloudLinux, or RHEL 7**, type:  
    ```
    systemctl restart syslog.service
    ```
    
      
    and press **Enter** If your server uses **CentOS, CloudLinux, or RHEL 5 or 6**, type:
    
      
    ```
    service syslog restart
    ```
    
      
    and press **Enter**.

That’s all! System logging will restart.

[Build now](/hosting/hosting-services/cloud-vps/)
