Overview
Docker Compose is the easiest way to run Rexec in production. This setup includes:- Rexec API Server - Main application server
- PostgreSQL - User data and container metadata
- Redis - Session management and caching
- Persistent volumes - For recordings, SSH keys, and databases
Prerequisites
Install Docker
Ensure Docker Engine 20.10+ and Docker Compose V2 are installed:Install from https://docs.docker.com/engine/install/
Configuration
Create Environment File
Copy the example environment file and configure it:Edit
.env with your configuration:.env
Deployment
Start Services
Navigate to the Docker directory and start all services:This will:
- Build the Rexec image from the Dockerfile
- Start PostgreSQL and Redis containers
- Start the Rexec API server
- Create persistent volumes for data
Verify Deployment
Check that all services are running:You should see three services:
rexec, postgres, and redis in the “Up” state.View logs:Docker Compose Configuration
Thedocker-compose.yml file defines the complete stack:
docker/docker-compose.yml
Enabling SSH Gateway
Rexec includes an optional SSH gateway that allows SSH access to containers:Managing the Deployment
View Logs
Restart Services
Stop Services
Update Rexec
Persistent Data
Docker Compose creates named volumes for persistent data:- postgres-data - User data, container metadata, audit logs
- redis-data - Session data and cache
- recordings-data - Terminal session recordings
- ssh-keys - SSH host keys for the gateway
Troubleshooting
Health Check Failing
Check if the API is responding:Database Connection Issues
Verify PostgreSQL is ready:Port Already in Use
Change the port mapping indocker-compose.yml:
Next Steps
Configuration
Learn about all environment variables and advanced configuration
Manual Setup
Deploy without Docker Compose