Linux, Web Server & Database
Install Nginx on VPS
Get Nginx properly installed and configured on your VPS as your web server.
The Problem
You need a working web server on a fresh VPS, but a bare `apt install nginx` leaves you with defaults that aren't tuned for your actual site, domain or traffic.
About this problem
Nginx is the most common choice for new VPS setups because it handles concurrent connections efficiently and plays well as both a web server and a reverse proxy, but the default install is intentionally minimal — no server block for your domain, no sensible worker/connection tuning, no firewall rule allowing traffic through.
This typically comes up right after provisioning a new VPS, before any site has been pointed at it yet.
What's Included
- Installing Nginx from the correct repository for your distro
- Setting up a server block (virtual host) for your actual domain
- Basic worker process and connection tuning for your VPS's resources
- Opening the firewall for HTTP/HTTPS and confirming the test page loads
What's NOT Included
- Installing an application stack behind it (PHP, Node, etc. — separate services)
- SSL certificate setup (see the Let's Encrypt service)
- Ongoing Nginx configuration as your site grows
How It Works
- Install Nginx via the distro's package manager and confirm the service starts and enables on boot.
- Create a server block for your domain under sites-available and symlink it into sites-enabled.
- Tune worker_processes and worker_connections against the VPS's actual CPU/RAM.
- Open the firewall (UFW/iptables) for ports 80 and 443.
- Test the configuration (nginx -t) and reload, then confirm the domain serves the expected content.
In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.
Frequently Asked Questions
- What is Nginx used for?
- Nginx is a web server that handles incoming HTTP requests and serves your website — it's also commonly used as a reverse proxy in front of other application servers.
- Is Nginx better than Apache?
- Neither is strictly better — Nginx tends to handle high concurrency more efficiently with lower memory use, while Apache has more flexible per-directory configuration via .htaccess. The right choice depends on your stack.
- Can Nginx and Apache run on the same server?
- Yes, commonly with Nginx in front as a reverse proxy and Apache behind it, or by running them on different ports — it just needs deliberate configuration to avoid port conflicts.
- Do I need Nginx if I'm just using WordPress?
- WordPress works fine on Nginx or Apache — Nginx is often chosen for its lighter resource use on busy WordPress sites, but it needs a WordPress-specific server block configuration (rewrite rules especially).
- Why does my browser show the default Nginx welcome page?
- That means Nginx installed correctly but no server block is yet pointing your domain at your actual site content — the default page is just a placeholder.
- How do I check if Nginx is actually running?
- The command systemctl status nginx shows its current state, and visiting the server's IP in a browser should show either your site or the default welcome page if nothing's configured yet.