AboutAI ToolsCursorClaude CodeLovableBolt.newAI tool reviewsTutorialsVibe codingAI agentsMobile apps with AIAll tutorialsBlogSponsorWork With MeJoin 285K+ Subscribers

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.

How to Deploy & Scale AI Apps on Cloudways - Full-Stack Tutorial
Published
20 November 2025
Length
14 min
Views
59,463 views
On YouTube
How to Deploy & Scale AI Apps on Cloudways - Full-Stack Tutorial

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

  1. 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.
  2. From the Cloudways dashboard, create a new server. I recommend DigitalOcean as the provider; pick a location like London.
  3. Choose your server specs. The platform breaks down hourly vs monthly costs so you can see exactly what you'll pay. Launch the server.
  4. 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.

  1. Initialise a Git repo locally and push your code to GitHub.
  2. In Cloudways, set up deployment via Git. Generate SSH keys inside the platform.
  3. Add the public SSH key to your GitHub repository's deploy keys.
  4. Add the Git remote (SSH URL) and authenticate the repository.
  5. 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

  1. 00:00 Intro: Your First AI App Is Ready… Now Deploy It
  2. 00:16 Full-Stack App Overview (Auth, DB, AI Models)
  3. 00:36 Showing env.local (OpenRouter, FAL, Google Auth, Neon DB)
  4. 00:54 What Is Cloudways?
  5. 01:12 Why Not Use Vercel/Netlify for High Traffic?
  6. 01:30 Real Example: Viral App → Huge Vercel Bills
  7. 01:47 Why Cloudways Is Better (Fixed Cost Hosting)
  8. 02:05 Free 3-Day Trial + 20% OFF Promo Code
  9. 02:22 Create Your Cloudways Account
  10. 02:40 Cloudways Dashboard Tour
  11. 03:00 Create Your First Server
  12. 03:20 Choosing Server Provider (DigitalOcean Recommended)
  13. 03:36 Selecting Location (Example: London)
  14. 03:50 Launching the Server (Specs Overview)
  15. 04:22 Cost Breakdown (Hourly vs Monthly)
  16. 04:40 Applications Explained (Your Hosted Projects)
  17. 05:00 Creating Multiple Applications
  18. 05:26 Application Setup in Progress
  19. 05:38 Preparing GitHub Repository for Deployment
  20. 06:20 Initializing Git & Pushing Code to GitHub
  21. 06:55 Setting Up Deployment via Git on Cloudways
  22. 07:12 Generating SSH Keys on Cloudways
  23. 07:35 Adding SSH Keys Inside GitHub
  24. 08:00 Adding Git Remote (SSH URL)
  25. 08:20 Authenticating Git Repository
  26. 08:40 Starting the Deployment
  27. 09:06 Opening SSH Terminal Inside Cloudways
  28. 09:30 Logging In via SSH (Username & Password)
  29. 09:56 Navigating Server Files via Terminal
  30. 10:16 Navigating to public_html Folder
  31. 10:30 Checking Dependencies & Node Modules
  32. 10:50 If Needed: Run npm install
  33. 11:10 Accessing Your Deployed Application URL
  34. 11:28 Project Successfully Deployed
  35. 11:46 Connecting Your Custom Domain (Domain Management)
  36. 12:10 Adding Your Domain (Example: mono.ai)
  37. 12:30 DNS Records & Nameserver Setup
  38. 12:48 Staging Management: Safe Deployment Workflow
  39. 13:18 Testing Changes on Staging Before Live Push
  40. 13:38 Installing Free SSL Certificate (Let’s Encrypt)
  41. 13:55 Backup & Restore Feature
  42. 14:10 Final Thoughts: Fixed Cost Hosting + Free Trial + Promo Code
Video description and links
🔗 Start Cloudways FREE Trial 👉 3-Day Free Trial — No Credit Card! https://unified.cloudways.com/signup?id=1977784&coupon=METAVERSE20 👉 Cloudways Pricing https://www.cloudways.com/en/pricing.php?id=1977784&data1=AIApponCW&data2=Oct 🎁 Use Code: METAVERSE20 Get 20% OFF for your first 3 months when upgrading from trial. In this video, I show you how to deploy a complete AI SaaS app — built with Next.js + OpenAI API + PostgreSQL — on Cloudways, step-by-step. You'll learn how to: ✅ Deploy a Node/Next.js AI app ✅ Connect PostgreSQL (Neon / Supabase) ✅ Add environment variables ✅ Use Git deployment + PM2 ✅ Enable 1-click FREE SSL ✅ Create staging → test → push to production ✅ Enable Redis / caching for speed ✅ Vertically scale your server (CPU/RAM) ✅ Add team members & access control ✅ Upgrade from trial → full account This is one of the cleanest hosting platforms for AI apps — and you can start with a 3-day free trial, no credit card required. 🛠️ Tech Stack Used in This Video Next.js OpenAI API PostgreSQL (via Neon / Supabase) Cloudways Custom Node App GitHub Deployment PM2 Runtime Redis / Cache Vercel Env Files replicated inside Cloudways Tailwind CSS (optional) 💡 Why Cloudways? Cloudways gives you: ⚡ Managed hosting for Node.js & custom apps ⚡ One-click staging environments ⚡ Free Let’s Encrypt SSL ⚡ Vertical scaling without migration ⚡ Redis / Varnish / Memcached performance boosts ⚡ Team access & role-based management ⚡ Actual human support ⚡ Zero vendor lock-in (choose DO, AWS, Vultr, GCP, Linode) Perfect for AI apps, SaaS builders, agencies, dev teams, and indie hackers. 📚 Chapters (Timestamps)

This article was written from the video's description with the help of AI. Watch the video for the full walkthrough.

Related tutorials