New

EmeraldHost 2.0 is here: faster, more intuitive, and made for everyone - the new panel!

Learn more
Guides
Services & ToolsInstall Webserver

How to install a web server on your Linux VPS

Install a web server on a Linux VPS running Ubuntu or Debian - complete guide for Apache2 and Nginx setup.

2 min read
May 14, 2025

Instructions for installing the web servers Apache2 and Nginx on a Linux VPS.

Apache2 and Nginx in comparison

Apache2:

  • Classic web server, very widely used
  • Supports .htaccess files
  • Simple configuration, ideal for beginners and WordPress hosting
  • Works process-based, which can lead to performance losses under high load

Nginx:

  • Modern, resource-saving web server
  • Works event-based → very performant under high load
  • No .htaccess support
  • Often used as a reverse proxy in front of Apache or other services

Apache2

  1. Update system
    First update the system of your server. Open the console and enter the following command:

    apt update && apt upgrade -y
    
  2. Install Apache2
    Install Apache2 by entering the following command in the console:

    sudo apt install apache2
    
  3. Default web directory
    After installation, you can upload your website files there:

    /var/www/html
    
  4. Test website
    Open a web browser and navigate to: http://<server-ip>

  5. Important commands
    Use the following commands to manage Apache2:

    sudo systemctl status apache2     # Displays the status of Apache2
    sudo systemctl restart apache2    # Restarts Apache2
    sudo systemctl enable apache2     # Enables Apache2 at system startup
    

Nginx

  1. Update system
    First update the system of your server. Open the console and enter the following command:

    apt update && apt upgrade -y
    
  2. Install Nginx
    Install Nginx by entering the following command in the console:

    sudo apt install nginx
    
  3. Default web directory
    After installation, you can upload your website files there:

    /var/www/html
    
  4. Test website
    Open a web browser and navigate to: http://<server-ip>

  5. Important commands
    Use the following commands to manage Nginx:

    sudo systemctl status nginx     # Displays the status of Nginx
    sudo systemctl restart nginx    # Restarts Nginx
    sudo systemctl enable nginx     # Activates Nginx at system startup
    
Written byEmeraldHost Team
Last updated on Mar 19, 2026 Edit on GitHub

Did this article help you?

Your feedback helps us improve our guides.

Help shape the guides

€10.00 in credit for every new guide, €5.00 for every improvement.

Contact Support

Create a support ticket and our team will get back to you as soon as possible – personal and professional.

Go to Support
1257 members online

Discord Community

Connect with other players, get quick help from the community, and stay up to date with the latest news.

Join Discord

Join our Discord community 1257 members online right now