Verifying the Presence of Apache Web Server on Your Raspberry Pi

A quick guide on how to verify if Apache web server is installed and running on your Raspberry Pi. Follow these simple steps to check if Apache is present on your device. …


Updated August 3, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


A quick guide on how to verify if Apache web server is installed and running on your Raspberry Pi. Follow these simple steps to check if Apache is present on your device.

Apache is a popular open-source web server that is commonly used for hosting websites and applications. If you are planning to host a website or application on your Raspberry Pi, it’s essential to know whether the Apache server is installed or not. In this article, we will discuss how to check if Apache is installed on your Raspberry Pi using the command line interface.

  1. Open the terminal on your Raspberry Pi:

    • To open the terminal, click on the menu icon (top-left corner) and select “Terminal”. Alternatively, you can use the keyboard shortcut Ctrl + Alt + T.
  2. Check if Apache is installed:

    • Type the following command in your terminal to check if Apache is already installed:
    sudo apache2ctl -v
    
    • If Apache is installed, you will see a message like this:
      Server version: Apache/2.4.38 (Raspbian)
      Server built:   2020-10-16T17:52:29
      
    • If Apache is not installed, you will see a message like this:
      The program 'apache2ctl' is currently not installed. You can install it by typing: sudo apt install apache2
      
  3. Check if Apache is running:

    • To check if the Apache server is currently running, use the following command:
    systemctl status apache2
    
    • If Apache is running, you will see a message like this:
      ● apache2.service - The Apache HTTP Server
         Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
         Active: active (running) since Fri 2021-09-17 12:34:56 UTC; 3min 28s ago
      
    • If Apache is not running, you will see a message like this:
      ● apache2.service - The Apache HTTP Server
         Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
         Active: inactive (dead) since Fri 2021-09-17 12:34:56 UTC; 3min 28s ago
      
  4. Start Apache if it’s not running:

    • If Apache is installed but not running, you can start it using the following command:
    sudo systemctl start apache2
    
    • After starting Apache, verify that it is running by using the systemctl status apache2 command.
  5. Access your Raspberry Pi’s IP address:

    • To check if you can access your Raspberry Pi through the web browser, find out its IP address by running:
    hostname -I
    
    • Open a web browser on another device and enter the IP address in the address bar. For example, if your Raspberry Pi’s IP address is 192.168.0.10, type http://192.168.0.10 in the browser.
    • If you see the default Apache welcome page, it means that Apache is successfully installed and running on your Raspberry Pi.

That’s it! You have now learned how to check if Apache is installed on your Raspberry Pi and ensure that it is running. Remember to install Apache using sudo apt install apache2 if it is not already present, and start the service using sudo systemctl start apache2 to get started with web hosting on your Raspberry Pi.