Right now, it does nothing
A VPS on its own doesn't host a website — it's just a locked, empty computer.
To make it answer when a browser comes knocking, you install a program that specifically listens for that knock and hands back a web page: a web server. You'll install the most common one there is — Apache.
Install the web server
Logged in as your regular user (not root, remember), install Apache:
rob@my-vps:~$ sudo apt install apache2 -y
Setting up apache2 ...
apache2 is now running ✅
Apache started itself automatically. But your firewall from Stop 3 only lets SSH through — open the door for the web too:
rob@my-vps:~$ sudo ufw allow 'Apache Full'
Rule added ✅
"Apache Full" opens both the everyday door (port 80) and the padlocked one you'll switch on at Stop 6 (port 443) — one command now saves you a trip back here later.
Go look
Open a browser — any browser, on any device — and type your VPS's address straight in.
Apache2 Ubuntu Default Page
It works!
Add PHP
Give your VPS the ability to run PHP:
rob@my-vps:~$ sudo apt install php libapache2-mod-php -y
Setting up php ...
rob@my-vps:~$ sudo systemctl restart apache2
Apache restarted with PHP ✅
Move in
Apache always looks in one folder for what to show: /var/www/html/. Right now, your account can't write there — it belongs to the system. Hand it to yourself:
rob@my-vps:~$ sudo chown -R rob:rob /var/www/html
Now write your own page over the default one:
rob@my-vps:~$ nano /var/www/html/index.php
<?php echo "Hello from my very first VPS!"; ?>
Ctrl+O, Enter, Ctrl+X to save
Refresh the browser tab from Step 2:
Hello from my very first VPS!
Yours. Really yours.
What your VPS can do now
- ✓Apache is installed and runninganswers any browser that visits your IP
- ✓Ports 80 and 443 are opensudo ufw allow 'Apache Full'
- ✓PHP is installedready for PHP-based sites
- ✓You own the web folder/var/www/html, editable by you — by hand or by SFTP
It's alive. 🏠
Right now, only your IP address finds it. Next: give it a real name.
Next up → Stop 5: Hang the SignMy Very First VPS · Stop 4 of 7