CLI Reference
Complete command-line interface reference for Gokku.
Installation
Client (Local Machine)
curl -fsSL https://gokku-vm.com/install | bash -s -- --client
Server
curl -fsSL https://gokku-vm.com/install | bash -s -- --server
Global Options
-a, --app <app-name>
- Specify app name (e.g.,api-production
,vad-staging
)--version, -v
- Show version information--help, -h
- Show help information
The -a/--app
flag uses your git remote name:
- Must be a configured git remote
- Gokku runs
git remote get-url <name>
to extract connection info - Environment is parsed from the remote name suffix
How it works:
You add a git remote (standard git command):
bashgit remote add api-production ubuntu@server:api git remote add vad-staging ubuntu@server:vad
Gokku parses the remote URL to extract:
- SSH host:
ubuntu@server
- App name:
api
(from/repos/api.git
)
- SSH host:
You use the app name directly:
bashgokku config set PORT=8080 -a api-production gokku logs -a vad-staging -f
Commands
Server Management
gokku server add <app_name> <user@server_ip>
Add a new server remote.
gokku server add stt ubuntu@54.233.138.116
gokku server list
List all configured remotes.
gokku server list
gokku server remove <remote_name>
Remove a server remote.
gokku server remove stt
Application Management
gokku apps list
List applications on the server.
gokku apps list -a api-production
gokku apps create <app>
Create a new application.
gokku apps create myapp -a myapp
gokku apps destroy <app>
Destroy an application.
gokku apps destroy myapp -a myapp
Configuration
gokku config set KEY=VALUE [-a <app>]
Set environment variables.
# Remote execution
gokku config set PORT=8080 -a api-production
gokku config set DATABASE_URL="postgres://..." -a api-production
# Local execution (on server)
gokku config set PORT=8080 --app api
gokku config get KEY [-a <app>]
Get environment variable value.
gokku config get PORT -a api-production
gokku config list [-a <app>]
List all environment variables.
gokku config list -a api-production
gokku config unset KEY [-a <app>]
Remove environment variable.
gokku config unset PORT -a api-production
Execution
gokku run <command> [-a <app>]
Run arbitrary commands inside the application container.
# Remote execution (inside container)
gokku run bundle exec rails console -a api-production
gokku run npm install -a myapp
gokku run python manage.py shell -a django-app
# Local execution (on server, inside container)
gokku run bundle exec rails console --app api
Security Note: Commands are executed inside the application's Docker container (named after the app), not directly on the server. This provides isolation and security.
Container Naming: The container name matches the application name (e.g., stt
, api-production
).
Logs
gokku logs [-a <app>] [-f]
View application logs.
# Remote execution
gokku logs -a api-production -f
gokku logs -a api-production
# Local execution (on server)
gokku logs api production -f
Status
gokku status [-a <app>]
Check service status.
# Remote execution
gokku status -a api-production
# Local execution (on server)
gokku status
Restart
gokku restart [-a <app>]
Restart services.
# Remote execution
gokku restart -a api-production
# Local execution (on server)
gokku restart api
Deployment
gokku deploy [-a <app>]
Deploy applications.
# Remote execution
gokku deploy -a api-production
# Local execution (on server)
gokku deploy api
Rollback
gokku rollback [-a <app>] [release-id]
Rollback to previous release.
# Remote execution
gokku rollback -a api-production
gokku rollback -a api-production 2
# Local execution (on server)
gokku rollback api production
SSH
gokku ssh [-a <app>]
SSH to server.
gokku ssh -a api-production
Examples
Basic Workflow
# 1. Add server remote
gokku server add api ubuntu@54.233.138.116
# 2. Set environment variables
gokku config set PORT=8080 -a api
gokku config set DATABASE_URL="postgres://..." -a api
# 3. Deploy application
gokku deploy -a api
# 4. Check status
gokku status -a api
# 5. View logs
gokku logs -a api -f
Rails Application
# Connect to Rails console (inside container)
gokku run bundle exec rails console -a api-production
# Run database migrations (inside container)
gokku run bundle exec rails db:migrate -a api-production
# Check application status
gokku status -a api-production
Node.js Application
# Install dependencies (inside container)
gokku run npm install -a myapp
# Run build process (inside container)
gokku run npm run build -a myapp
# Check logs
gokku logs -a myapp -f
Python/Django Application
# Connect to Django shell (inside container)
gokku run python manage.py shell -a django-app
# Run migrations (inside container)
gokku run python manage.py migrate -a django-app
# Install Python packages (inside container)
gokku run pip install requests -a django-app
Environment Variables
Gokku supports environment-specific configuration:
# Set production environment variables
gokku config set NODE_ENV=production -a api-production
# Set staging environment variables
gokku config set NODE_ENV=staging -a api-staging
Troubleshooting
Common Issues
Remote not found: Make sure the git remote exists
bashgit remote -v
Permission denied: Check SSH key configuration
bashssh -T ubuntu@your-server
App not found: Verify the app exists on the server
bashgokku apps list -a your-app
Next Steps
- Configuration Reference - Config file docs
- Getting Started Guide - Quick start tutorial
- Examples - Real-world usage examples