Video tutorial · The Metaverse Guy
Deploy and Scale AI Apps on Cloudways: Full-Stack Tutorial
Learn step by step how to deploy a Next.js + OpenAI + PostgreSQL AI SaaS app on Cloudways with Git, SSL, staging, and vertical scaling.
This video was made in partnership with Cloudways. It carries YouTube's paid-promotion label.
- Published
- 20 November 2025
- Length
- 14 min
- Views
- 59,463 views
I walk through deploying a complete AI SaaS app built with Next.js, OpenAI API, and PostgreSQL onto Cloudways. You'll see how to set up a server, connect a database, deploy via Git with PM2, enable free SSL, create staging environments, and scale vertically—all with a fixed-cost host that avoids runaway bills.
Why Choose Cloudways for Your AI App
Vercel and Netlify are great for small projects, but if your AI app goes viral the per-request billing can become hugely expensive. Cloudways gives you fixed-cost managed hosting on your choice of cloud provider—DigitalOcean, AWS, Vultr, GCP, or Linode—without vendor lock-in.
You get a full Node.js environment with PM2 runtime, one-click staging, free SSL, Redis/Vanish/Memcached caching, team access roles, and actual human support. It's ideal for SaaS builders, agencies, and indie hackers who want predictable costs.
Getting Started: Trial, Account & Server
- Sign up for the 3-day free trial at the link in the description—no credit card needed. Use code METAVERSE20 for 20% off your first three months when upgrading.
- From the Cloudways dashboard, create a new server. I recommend DigitalOcean as the provider; pick a location like London.
- Choose your server specs. The platform breaks down hourly vs monthly costs so you can see exactly what you'll pay. Launch the server.
- Once the server is ready, create an application—this is where your project will be hosted. You can create multiple applications on the same server.
Preparing Your Next.js AI App for Git Deploy
My app uses Next.js, OpenAI API, PostgreSQL (via Neon or Supabase), and Tailwind CSS. Before deploying, I made sure the code is in a GitHub repository. Cloudways uses Git to pull your code and PM2 to run it as a persistent process.
- Initialise a Git repo locally and push your code to GitHub.
- In Cloudways, set up deployment via Git. Generate SSH keys inside the platform.
- Add the public SSH key to your GitHub repository's deploy keys.
- Add the Git remote (SSH URL) and authenticate the repository.
- Start the deployment. Cloudways pulls the code and runs the build automatically.
Enviroment Variables, Database & Caching
You'll replicate your local env file inside Cloudways. Add all necessary keys—OpenRouter, FAL, Google Auth, and your database connection string. For PostgreSQL, I use Neon or Supabase; just copy the database URL into the env variables screen.
You can also enable Redis caching from the server management panel to improve response times without changing your code.
Staging, SSL & Going Live
Cloudways leys you create a staging environment with one click. You can clone your app, test changes, and then push to production safely.
Enable free Let's Encrypt SSL with a single click—no CLI certbot commands needed. Your app will be served over HTTPS immediately.
When you are ready to upgrade from the trial, use the code METAVERSE20 for a discount on your first three months. Team members can be added with role-based access control directly from the dashboard.
Vertical Scaling Without Migration
If your traffic grows, you can vertically scale the server (increase CPU and RAM) without migrating to a larger plan. Just adjust the resources from the dashboard—no downtime.
Tools used in this video
- Next.js
- OpenAI API
- PostgreSQL (Neon / Supabase)
- Cloudways Custom Node App
- GitHub Deployment
- PM2 Runtime
- Redis caching
- Tailind CSS
- DigitalOcean
- OpenRouter (via env)
- FAL (via env)
- Google Auth (via env)
Questions
- Do I need a credit card to try Cloudways?
- No. The 3-day free trial does not require a credit card. You can test the full platform before deciding to upgrade.
- Can I use my own PostgreSQL database with Cloudways?
- Yes. You can connect any PostgreSQL database by adding the connection string as an environment variable. In the tutorial I used Neon and Supabase.
- How does Git deployment work with Cloudways?
- You generate SSH keys inside Cloudways, add the public key to your GitHub repository, and authenticate. Cloudways then pulls your code and uses PM2 to run the Node/Next.js app.
- What if my AI app gets a sudden spike in traffic?
- You can vertically scale your server's CPU and RAM with a few clicks, without migrating to a new server. You also have the option to enable Redis caching for extra speed.
Topics
Chapters
- 00:00 Intro: Your First AI App Is Ready… Now Deploy It
- 00:16 Full-Stack App Overview (Auth, DB, AI Models)
- 00:36 Showing env.local (OpenRouter, FAL, Google Auth, Neon DB)
- 00:54 What Is Cloudways?
- 01:12 Why Not Use Vercel/Netlify for High Traffic?
- 01:30 Real Example: Viral App → Huge Vercel Bills
- 01:47 Why Cloudways Is Better (Fixed Cost Hosting)
- 02:05 Free 3-Day Trial + 20% OFF Promo Code
- 02:22 Create Your Cloudways Account
- 02:40 Cloudways Dashboard Tour
- 03:00 Create Your First Server
- 03:20 Choosing Server Provider (DigitalOcean Recommended)
- 03:36 Selecting Location (Example: London)
- 03:50 Launching the Server (Specs Overview)
- 04:22 Cost Breakdown (Hourly vs Monthly)
- 04:40 Applications Explained (Your Hosted Projects)
- 05:00 Creating Multiple Applications
- 05:26 Application Setup in Progress
- 05:38 Preparing GitHub Repository for Deployment
- 06:20 Initializing Git & Pushing Code to GitHub
- 06:55 Setting Up Deployment via Git on Cloudways
- 07:12 Generating SSH Keys on Cloudways
- 07:35 Adding SSH Keys Inside GitHub
- 08:00 Adding Git Remote (SSH URL)
- 08:20 Authenticating Git Repository
- 08:40 Starting the Deployment
- 09:06 Opening SSH Terminal Inside Cloudways
- 09:30 Logging In via SSH (Username & Password)
- 09:56 Navigating Server Files via Terminal
- 10:16 Navigating to public_html Folder
- 10:30 Checking Dependencies & Node Modules
- 10:50 If Needed: Run npm install
- 11:10 Accessing Your Deployed Application URL
- 11:28 Project Successfully Deployed
- 11:46 Connecting Your Custom Domain (Domain Management)
- 12:10 Adding Your Domain (Example: mono.ai)
- 12:30 DNS Records & Nameserver Setup
- 12:48 Staging Management: Safe Deployment Workflow
- 13:18 Testing Changes on Staging Before Live Push
- 13:38 Installing Free SSL Certificate (Let’s Encrypt)
- 13:55 Backup & Restore Feature
- 14:10 Final Thoughts: Fixed Cost Hosting + Free Trial + Promo Code
Video description and links
This article was written from the video's description with the help of AI. Watch the video for the full walkthrough.
Related tutorials
▶Qoder.ai: A New Way To Build Full-Stack Apps Instantly - Qoder.ai Builds Complex Apps From Scratch
Watch & read
▶Build AI Agents No Code using ASCN AI: How I Made $4,200 in 30 Days
Watch & read
▶