Uploading files is only half the job. A Cloud Server does not answer web visitors until you install a web server program, and until you open the ports that web traffic uses. This article does both. Copy each command exactly, one line at a time.
Connect to your server first: How to connect to your Cloud Server.
1. Install the web server
We use Apache here because it works with plain files and with WordPress, with no extra configuration.
sudo apt update
sudo apt install -y apache2
sudo systemctl enable --now apache2
Check it is running:
systemctl status apache2
You want to see active (running). Press q to come back to the prompt.
2. Open the ports on the server's own firewall
Your server runs a firewall that blocks everything it was not told to allow. Web traffic uses port 80 (http) and port 443 (https).
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw status
The status list should now include 80 and 443. If it says Status: inactive, this firewall is off on your image and there is nothing to do here.
Never turn off the whole firewall to "make it work". Leave SSH on 2200 allowed, or you will lock yourself out.
3. Open the same ports in the console
The console has a second firewall in front of every server, called a Security Group, and it also blocks web traffic by default. A new server allows only SSH on 2200 and remote desktop, so your site stays invisible until you add these rules.
In the console: Networking, then Security Groups, open the group your server uses, and add two rules:
- Direction Ingress, protocol TCP, port 80, remote 0.0.0.0/0
- Direction Ingress, protocol TCP, port 443, remote 0.0.0.0/0
0.0.0.0/0 means "anyone on the internet", which is what a public website needs. The full walkthrough with every field is in How to open a port on your server.
4. Put your files where the web server reads them
Apache serves one folder:
/var/www/html
Upload your site into it with FileZilla. Your home page must be called index.html. If a file called index.html already exists there, it is Ubuntu's default page, and yours should replace it.
5. Look at your site
In a browser, type your server's public IP address:
http://102.215.225.40
Use your own IP, and type http:// at the front. Browsers now assume https, and https will not work until you reach Turn on HTTPS.
You should see your home page. If you see Ubuntu's default Apache page instead, your files are not in /var/www/html, or your home page is not named index.html.
6. Add your domain and HTTPS
A site on a bare IP address works, but nobody will type it and browsers will call it "Not secure". Finish with Point your domain name at your server and then Turn on HTTPS.
If nothing opens
Go through My website does not open. Nine times out of ten it is step 2 or step 3 above: one of the two firewalls is still closed.