There is a specific kind of freedom that comes from owning your own "metal." While platforms like Vercel and Netlify are magical for front-end developers, they often lead to a "black box" dependency that gets expensive once your SaaS starts doing real work. For a founder, spending $25/month on a predictable, high-performance [AWS Lightsail instance](https://aws.amazon.com/lightsail/pricing/) is often the smarter "Steward" move. The beauty of this setup is that it's **framework agnostic**. Whether you are building with Nuxt, SvelteKit, or Next.js, the infrastructure logic stays exactly the same. You can even run all three on the same $25 server! ![The $25 SaaS Stack: Deploying Nuxt, SvelteKit, or Next.js on AWS Lightsail](/assets/images/infog/the-25-dollar-saas-stack-deploying-on-aws-lightsail.webp) This is a comprehensive, updated guide on how I deploy modern full-stack applications and Node.js APIs on Ubuntu 20.04 LTS. We're moving from a raw .PEM file to a fully automated CI/CD pipeline with GitHub Actions. ### Phase 2: Server Hardening & Runtime Once you're inside the server (`stag-app`), it's time to install the engine. #### 1. Update Everything ```bash sudo apt-get update && sudo apt-get upgrade -y ``` #### 2. Install Node.js I prefer using the NodeSource repository to get specific versions. For most modern Nuxt apps, Node 18+ is the way to go. ```bash curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs build-essential ``` #### 3. The "Besh" Alias Set I can't work without my shortcuts. I always add these to `~/.bash_aliases` to turn a raw terminal into a cockpit: ```bash # General Shortcuts alias l='ls -lah' alias hg='history|grep' alias nreset='sudo systemctl restart nginx' alias ncheck='sudo nginx -t' # App Shortcuts alias appcd='cd ~/my-app' alias appbuild='cd ~/my-app && git pull && npm install && npm run build && pm2 restart ecosystem.config.js' ``` ### Phase 4: The Gateway (NGINX & SSL) NGINX sits in front of your app, handling incoming traffic and passing it to Node. #### 1. Configuration Create a site config in `/etc/nginx/sites-available/app.carmelyne.com`: ```nginx server { listen 80; server_name app.carmelyne.com; location / { proxy_pass http://0.0.0.0:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } client_max_body_size 50M; # Essential for SaaS file uploads } ``` #### 2. Enable & Link ```bash sudo ln -sf /etc/nginx/sites-available/app.carmelyne.com /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl restart nginx ``` #### 3. SSL via Certbot Don't handle SSL manually. Let the robots do it. ```bash sudo apt install python3-certbot-nginx sudo certbot --nginx -d app.carmelyne.com ``` ### The Result: A Scalable $25 Powerhouse By following this flow, you’ve built more than just a website. You’ve built an **Infrastructure**. - **Nuxt / SvelteKit / Next.js** handles the reactive UI and server-side rendering. - **PM2** handles the process stability and cluster scaling. - **NGINX** handles the security, SSL, and routing. - **GitHub Actions** handles the continuous delivery. At $25/month, you have enough RAM and CPU to run a production SaaS with thousands of users without the "Vercel tax." This is how you build for the long term. 💚