Gothic Framework G symbol

Self-Hosted & PaaS

Gothic apps are just Go binaries — you can deploy them to any platform that runs Docker containers or Go binaries directly. Here are guides for popular platforms.

Single-binary builds (EMBEDDED)

For self-hosted container or VM deploys, set ServeStaticFiles: gothic.EMBEDDED in your gothic.config.go. This bakes your ./public folder into the server binary via go:embed and serves /public/* from that embed in production — giving you a single self-contained binary with no sidecar public/ folder to copy or mount.

package main

import gothic "github.com/gothicframework/core/config"

var Config = gothic.Config{
	ProjectName: "my-project",
	Runtime: gothic.RuntimeConfig{
		// Bake ./public into the binary — no sidecar public/ folder to ship.
		ServeStaticFiles: gothic.EMBEDDED,
	},
}

In dev mode (GOTHIC_MODE=dev) files are still served fresh from disk, so hot reload keeps working. Reserve EMBEDDED for self-hosting — not AWS, where CloudFront and S3 serve static assets and embedding would only bloat the Lambda. See AWS Request Signing and the cache strategies page for the AWS path.

Fly.io

Fly.io runs containers on a global edge network. Install the flyctl CLI and launch your app:

# Initialize and deploy
fly launch

# Set Redis connection string
fly secrets set REDIS_URL=your-redis-host:6379

# Deploy updates
fly deploy

Fly.io will detect your Dockerfile and deploy automatically. You can also provision Upstash Redis directly through Fly.

Railway

Railway offers one-click deployments with built-in database plugins. Install the Railway CLI:

# Initialize project
railway init

# Add a Redis plugin
railway add --plugin redis

# Deploy
railway up

Railway automatically injects the REDIS_URL environment variable from the Redis plugin into your app. No manual configuration needed.

Generic VPS

For any VPS (AWS EC2, Hetzner, Linode, etc.), SSH into your server and deploy with Docker Compose:

# SSH into your server
ssh user@your-server

# Clone and deploy
git clone https://github.com/your-org/your-repo.git
cd your-repo
docker compose up -d

For HTTPS, put Caddy or Nginx in front of your app as a reverse proxy. Caddy provides automatic HTTPS with zero configuration via Let's Encrypt.

Coming from a v2 project? Here's how to migrate it to v3 in one command!