Deployment Guide: Dokploy, Orbita, VPS & Vercel
Your app works locally. Now you need to put it on the internet. In this course, you will learn four deployment methods — from the simplest one-command deploy to full PaaS setups — so you can choose the right approach for your project.
Deployment Options Overview
Grit apps can be deployed in multiple ways depending on your needs, budget, and technical comfort level. Here are the four methods you will learn:
| Method | What It Is | Best For |
|---|---|---|
| grit deploy | Direct VPS deployment via SCP | Quick deploys, solo developers |
| Dokploy | Self-hosted PaaS with web UI | Teams, auto-deploy on push |
| Orbita | Grit-native deployment platform | Grit projects, seamless integration |
| Vercel | Managed hosting for Next.js | Next.js frontend (API on VPS) |
Challenge: Choose Your Factors
What factors would you consider when choosing a deployment method? Think about: cost, complexity, automation, team size, frequency of deploys, and whether you want a web UI to manage your server.
Method 1: grit deploy (Direct VPS)
The simplest deployment method. One command builds your app, uploads it to your server, and configures everything automatically:
grit deploy --host deploy@server.com --domain myapp.comHere's what grit deploy does behind the scenes:
- 1. Builds the Go binary — cross-compiles for Linux (your server's OS)
- 2. Uploads via SCP — securely copies the binary to your server
- 3. Creates a systemd service — so your app auto-restarts on crash or reboot
- 4. Configures Caddy — reverse proxy with automatic HTTPS (Lets Encrypt)
- 5. Starts the service — your app is live at your domain
ssh deploy@server.com. If that works, grit deploy will work too.Challenge: List the Deploy Steps
Without looking above, list the 5 steps that grit deploy performs. For each step, explain why it's necessary.
Method 2: Dokploy
https://dokploy.comWhile grit deploy is a one-time push, Dokploy gives you a full deployment pipeline:
- • Git push to deploy — Dokploy watches your repo and auto-deploys on push
- • Web dashboard — manage apps, view logs, set environment variables from a browser
- • Docker-based — each app runs in an isolated container
- • Auto-SSL — HTTPS certificates managed automatically
- • Database management — spin up PostgreSQL, Redis, and more from the UI
To set up Dokploy on your VPS:
# Install Dokploy (one command)
curl -sSL https://dokploy.com/install.sh | shAfter installation, access the Dokploy dashboard at https://your-server-ip:3000. From there, connect your GitHub account, select your repository, and Dokploy handles the rest.
Challenge: Explore Dokploy
Visit dokploy.com. What features does it offer? How does it compare to Heroku or Railway? What databases can it manage?
Dokploy Configuration
Dokploy uses Docker to build and run your app. Grit scaffolds a production-ready Dockerfile that uses multi-stage builds to keep the final image small:
# Stage 1: Build the Go binary
FROM golang:1.24 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/server
# Stage 2: Create a minimal runtime image
FROM alpine:latest
COPY --from=builder /app/server /server
EXPOSE 8080
CMD ["/server"]FROM statements in a single Dockerfile. The first stage (builder) has all the build tools — Go compiler, source code, dependencies. The final stage only contains the compiled binary. This dramatically reduces the image size: the builder stage might be 1 GB, but the final image is only 15-20 MB.For the full stack (API + database + Redis), use the production Docker Compose file:
version: '3.8'
services:
api:
build: .
ports:
- "8080:8080"
env_file: .env
depends_on:
- db
- redis
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: myapp
POSTGRES_USER: myapp
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:7-alpine
volumes:
- redisdata:/data
volumes:
pgdata:
redisdata:In Dokploy, you can configure environment variables through the web UI instead of managing.env files on the server. Set your database credentials, JWT secret, API keys, and other sensitive values securely through the dashboard.
Challenge: Read the Dockerfile
Look at the Dockerfile above. What's the difference between the builder stage and the final stage? Why does the final stage use alpine:latest instead of golang:1.24? What would happen to the image size if you used only one stage?
Method 3: Orbita
https://github.com/MUKE-coder/orbitaOrbita is purpose-built for Grit's ecosystem. While Dokploy is a general-purpose PaaS, Orbita understands Grit conventions:
- • One-click deploy — connect your server, select a Grit project, deploy
- • Auto-SSL — HTTPS certificates managed automatically via Lets Encrypt
- • Environment management — configure production .env through the UI
- • Log viewing — stream application logs from the dashboard
- • Server management — manage multiple servers and apps from one place
The deployment flow with Orbita:
- 1. Install Orbita on your VPS (or use a separate management server)
- 2. Add your server's SSH credentials in the Orbita dashboard
- 3. Connect your GitHub repository
- 4. Configure environment variables and domain
- 5. Click Deploy — Orbita builds and ships your app
Challenge: Explore Orbita
Visit the Orbita GitHub repo at https://github.com/MUKE-coder/orbita. What deployment features does it support? How does the setup process compare to Dokploy?
Orbita vs Dokploy
Both are self-hosted PaaS tools, but they serve slightly different purposes:
| Feature | Orbita | Dokploy |
|---|---|---|
| Grit integration | Native — built for Grit | Generic — works with any Docker app |
| Ecosystem | Same creator as Grit | Independent project |
| Use case | Grit-first deployment | Any Docker-based app |
| Web UI | Yes | Yes |
| Auto-SSL | Yes | Yes |
| Database management | Yes | Yes (more options) |
Challenge: Compare the Two
You have 3 apps to deploy: a Grit SaaS, a Python Flask API, and a static marketing site. Which deployment tool (Orbita or Dokploy) would you use for each, and why?
Method 4: Vercel (Frontend Only)
For Triple or Double architecture projects with a Next.js frontend, you can deploy the frontend to Vercel while keeping the Go API on your VPS. This gives you the best of both worlds — Vercel's CDN and edge network for the frontend, your own server for the API.
# Step 1: Deploy the Go API to your VPS
grit deploy --host deploy@server.com --domain api.myapp.com
# Step 2: Deploy the Next.js frontend to Vercel
cd apps/web && vercelThe critical configuration step: tell the Vercel-hosted frontend where to find your API. In Vercel's dashboard, set this environment variable:
NEXT_PUBLIC_API_URL=https://api.myapp.comgo:embed and served by the Go server directly. There's nothing to deploy to Vercel.Advantages of the Vercel + VPS split:
- • Global CDN — frontend served from edge nodes closest to the user
- • Automatic previews — every PR gets a preview deployment URL
- • Zero-config — Vercel auto-detects Next.js and configures everything
- • Free tier — generous free plan for personal projects
Challenge: The Connection Point
What environment variable connects the Vercel frontend to your API? Why does the variable name start with NEXT_PUBLIC_? What would happen if you forgot to set it?
DNS Configuration
After buying a domain, you need to point it at your server by creating DNS records in your domain registrar's dashboard (Namecheap, Cloudflare, GoDaddy, etc.):
| Type | Name | Value | Purpose |
|---|---|---|---|
| A | @ | 167.99.100.50 | Root domain (myapp.com) |
| A | api | 167.99.100.50 | API subdomain (api.myapp.com) |
| CNAME | www | myapp.com | www subdomain redirects to root |
dnschecker.org.Challenge: Plan Your DNS Records
If your server IP is 167.99.100.50 and your domain is myapp.com, what DNS records would you create for: (1) the main site at myapp.com, (2) the API at api.myapp.com, (3) www.myapp.com redirecting to myapp.com?
Production Environment Variables
Your development .env file has placeholder values that are not safe for production. Before deploying, you need to update several critical variables:
# App
APP_ENV=production
APP_PORT=8080
# Database
DB_DRIVER=postgres
DB_HOST=localhost
DB_PORT=5432
DB_USER=myapp
DB_PASSWORD=<strong-random-password>
DB_NAME=myapp_production
# Auth
JWT_SECRET=<64-character-random-string>
# Storage
STORAGE_DRIVER=s3
S3_BUCKET=myapp-uploads
S3_REGION=us-east-1
S3_ACCESS_KEY=<your-access-key>
S3_SECRET_KEY=<your-secret-key>
# Email
RESEND_API_KEY=re_<your-real-key>
EMAIL_FROM=noreply@myapp.com
# Redis
REDIS_URL=redis://localhost:6379Critical changes from development to production:
- • APP_ENV — set to
production(disables debug logging, enables security headers) - • JWT_SECRET — must be a long, random string (not "secret" or "changeme")
- • DB_PASSWORD — a strong, unique password (not "password")
- • STORAGE_DRIVER — switch from local to S3, R2, or B2 for persistent file storage
- • RESEND_API_KEY — your real Resend API key (development uses Mailhog)
openssl rand -hex 32Challenge: Write a Production .env
Write a complete production .env file for your app. Use placeholder values (not real secrets), but make sure every required variable is present. How many variables changed from your development .env?
SSL/TLS Certificates
The good news: you almost never need to manage SSL certificates manually. Each deployment method handles it automatically:
- • grit deploy — Caddy auto-provisions Lets Encrypt certificates
- • Dokploy — built-in Lets Encrypt support through the dashboard
- • Orbita — automatic SSL certificate management
- • Vercel — SSL included automatically for all deployments
Challenge: Check Your SSL
After deploying your app, visit https://www.ssllabs.com/ssltest/ and enter your domain. What grade does your site receive? An A or A+ is expected with Caddy's default configuration.
Monitoring After Deployment
Deploying your app is only half the job. You also need to know when something goes wrong. There are two types of monitoring:
Recommended monitoring setup:
- • Pulse — built into Grit, shows response times, error rates, and active connections
- • UptimeRobot (free) — pings your health endpoint every 5 minutes, alerts on downtime
- • Better Stack (free tier) — uptime monitoring + incident management + status pages
Every Grit app has a health endpoint at /api/health that returns the app's status. Point your uptime monitor at this endpoint.
Challenge: Set Up Uptime Monitoring
Create a free account at uptimerobot.com. Add a monitor for your deployed API's health endpoint (https://api.myapp.com/api/health). Set the check interval to 5 minutes. What alerts did you configure?
What You Learned
- Four deployment methods: grit deploy, Dokploy, Orbita, and Vercel
- How
grit deploybuilds, uploads, and configures your app in one command - Dokploy as a self-hosted PaaS with Docker and auto-deploy
- Orbita as a Grit-native deployment platform
- Splitting frontend (Vercel) and API (VPS) deployment
- DNS configuration for domains and subdomains
- Production environment variables and security
- Automatic SSL with Lets Encrypt
- Monitoring with Pulse and uptime services
Challenge: Deploy End-to-End
Choose ONE deployment method and deploy a Grit app from start to finish:
- Scaffold a project with
grit new deploy-test --double --next - Generate at least one resource
- Deploy using your chosen method
- Configure DNS for your domain
- Verify HTTPS works
- Set up uptime monitoring
- Document every step you took
Challenge: Compare Two Methods
Deploy the same app using two different methods (e.g., grit deploy and Dokploy). Compare the experience: setup time, ease of re-deployment, log access, and environment variable management. Which do you prefer and why?
Challenge: Production Checklist
Create a deployment checklist for your team. Include: environment variables to change, DNS records to create, SSL verification, uptime monitoring setup, and a rollback plan. Would this checklist change depending on the deployment method?
Enjoying the course?
Help us grow — star us on GitHub, subscribe on YouTube, and follow on LinkedIn.