Getting Started
Get Gokku up and running in minutes.
Quick Start (Recommended)
Step 1: Setup Server
From your local machine, run one command to setup everything:
gokku remote setup user@server_ipThis will:
- Install Gokku on the server
- Install essential plugins (nginx, letsencrypt, cron, postgres, redis)
- Configure SSH keys
- Verify installation
- Create default "gokku" remote for easy commands
For a deeper walkthrough, see the dedicated Remote Setup guide.
Step 2: Create App on Server
From your local machine (no SSH needed):
gokku apps create api-production --remoteStep 3: Add Remote for Deployment
From your local machine:
gokku remote add api-production user@server_ipStep 4: Deploy
git push api-production mainThat's it! Your app is live. 🎉
Detailed Guide
Alternative: Manual Installation
If you prefer to install manually:
Install on Server
SSH into your server and run:
curl -fsSL https://gokku-vm.com/install | bash -s -- --serverThis installs:
- Gokku scripts
- Required dependencies
Install CLI (Optional but Recommended)
Install the gokku CLI on your local machine:
curl -fsSL https://gokku-vm.com/install | bash -s -- --clientThe CLI makes it easier to manage your deployments without SSH commands.
Verify installation:
gokku versionCreate Configuration
In your project root, create gokku.yml:
apps:
api:
path: ./cmd/api
binary_name: api
go_version: "1.25"
goos: linux
goarch: amd64
cgo_enabled: 0Create Application
Add a git remote for your application:
# Add git remote
gokku remote add api-production user@server_ipThe application will be automatically created on first deployment.
Deploy
Now deploy your application:
Using gokku CLI:
gokku deploy -a productionOr manual git push:
# Push - deployment happens automatically!
git push api-production mainWatch the magic happen:
-----> Deploying api to production...
-----> Checking if auto-setup is needed...
-----> First deploy detected, running auto-setup...
-----> Found gokku.yml, configuring from repository...
-----> Created .env file from gokku.yml configuration
-----> Auto-setup complete!
-----> Extracting code...
-----> Building Go application...
-----> Building Docker image...
-----> Build complete
-----> Deploying with blue-green deployment...
-----> Starting green container...
-----> Health check passed
-----> Switching traffic to green
-----> Deploy successful!Step 6: Manage Your App
Using gokku CLI:
# View logs
gokku logs -a api-production -f
# Check status
gokku status -a api-production
# Configure environment
gokku config set PORT=8080 -a api-production
gokku config set DATABASE_URL="postgres://..." -a api-production
# Restart
gokku restart -a api-production
# Run commands
gokku run "docker ps" -a api-productionOr use SSH directly:
ssh ubuntu@your-server "docker ps | grep api"Your app is live! 🎉
What Happened?
- Git push triggered the post-receive hook
- Auto-setup detected first deploy and configured from gokku.yml
- Code extracted to a new release directory
- Docker image built from your application code
- Blue-green deployment started new container
- Health checks performed on new container
- Traffic switched to new container (zero downtime)
- Old container stopped and cleaned up
Next Steps
- Configuration - Customize your deployment
- Plugins - Add databases, load balancers, and more
- Environment Variables - Configure your app
- Blue-Green Deployment - Zero-downtime deployments
Common Issues
SSH Permission Denied
Make sure your SSH key is added to the server:
ssh-copy-id ubuntu@your-serverBuild Failed
Check the deployment logs:
# Using CLI
gokku logs -a api-production
# Or directly
ssh ubuntu@your-server "docker logs api-blue"Port Already in Use
Set a different port using gokku CLI:
# Using gokku CLI
gokku config set PORT=8081 -a api-productionTroubleshooting
See Troubleshooting for more help.