Deploy a Web Application
Deploy a production-ready web application on Octos Cloud. This guide walks through VM provisioning, Nginx setup, SSL configuration, and domain mapping.
Architecture
User → DNS (yourdomain.com)
→ Octos Cloud Public IP
→ Nginx (reverse proxy, SSL termination)
→ Application (Node.js / Python / PHP)
→ Database (PostgreSQL / MySQL)
Step 1: Provision infrastructure
Create the VM
- Navigate to Create Virtual Machine in your project
- Select Ubuntu 22.04 LTS
- Choose a plan:
gp.medium(2 vCPU, 4 GB RAM, 80 GB NVMe) is a solid starting point - Attach to a public network
- Add your SSH key
- Deploy
Configure the firewall
Create a security group with the following rules:
| Direction | Protocol | Port | Remote |
|---|---|---|---|
| Inbound | TCP | 22 | Your IP |
| Inbound | TCP | 80 | 0.0.0.0/0 |
| Inbound | TCP | 443 | 0.0.0.0/0 |
Step 2: Install your application stack
SSH into your VM and install dependencies:
# Update packages
sudo apt update && sudo apt upgrade -y
# Install Nginx
sudo apt install nginx -y
# Install Node.js (example)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install nodejs -y
# Install PM2 for process management
sudo npm install -g pm2
Deploy your application
# Clone your repo
git clone https://github.com/your-org/your-app.git /var/www/app
cd /var/www/app
# Install dependencies and build
npm install
npm run build
# Start with PM2
pm2 start npm --name "my-app" -- start
pm2 save
pm2 startup
Step 3: Configure Nginx
Create a reverse proxy configuration:
# /etc/nginx/sites-available/my-app
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
Enable the site:
sudo ln -s /etc/nginx/sites-available/my-app /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Step 4: Add SSL with Let's Encrypt
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Certbot will automatically configure Nginx for HTTPS and set up auto-renewal.
Step 5: Point your domain
Using Octos DNS
- Navigate to DNS Management → Create DNS Domain
- Add an
Arecord pointing to your VM's public IP - Update your domain registrar's nameservers to Octos DNS
Using an external DNS provider
Create an A record with your domain registrar pointing to the VM's public IP address.
Production checklist
- Security group restricts SSH to known IPs
- SSL certificate installed and auto-renewing
- Application runs via process manager (PM2, systemd)
- Automated snapshots configured for the VM
- Monitoring and alerts set up
- Firewall rules audited