Database
PostgreSQL connection string in the format
postgres://user:password@host:port/database?sslmode=disableDefault: postgres://hatch:hatch@localhost:5432/hatch?sslmode=disableExample: postgres://hatch:[email protected]:5432/hatch?sslmode=disableHTTP API
Address and port for the Hatch REST API serverDefault:
:8080Example: 127.0.0.1:8080Better Auth API key verification endpoint used by hatchd middleware for authenticationDefault:
http://127.0.0.1:3000/api/auth/api-key/verifyExample: http://127.0.0.1:3000/api/auth/api-key/verifyBase domain for the Hatch deployment. Used for VM subdomain routing.Example:
hatchvm.comReverse Proxy
Address and port for the reverse proxy that routes traffic to VMsDefault:
:9090Example: 127.0.0.1:9090Domain suffix for VM subdomain routing. When a request comes to
my-agent.hatchvm.com, it routes to the corresponding VM.Default: hatch.localExample: ${HATCH_BASE_DOMAIN} or hatchvm.comMaximum time to wait for a paused VM to wake up when receiving a proxy requestDefault:
60sExample: 30s, 2mData Storage
Directory for storing VM-related data, snapshots, and runtime filesDefault:
./dataExample: /data or /var/lib/hatchS3 Snapshot Storage
Hatch uses S3-compatible storage for VM snapshots. MinIO is recommended for local deployments.S3-compatible endpoint URL for snapshot storageExample:
http://127.0.0.1:9000Required for snapshot functionality. Leave empty to disable S3 snapshots.
S3 bucket name for storing VM snapshotsExample:
hatch-snapshotsThe bucket must exist before starting Hatch. S3 functionality is enabled only when this is set.
S3 region for the bucketDefault:
us-east-1Example: us-east-1 (for MinIO, this can be any value)S3 access key ID for authenticationExample:
minioadminS3 secret access key for authenticationExample:
minioadminFirecracker Configuration
Path to the Firecracker binary executableDefault:
firecrackerExample: /root/firecracker/firecrackerPath to the default Linux kernel image for VMsExample:
/root/firecracker/vmlinux-5.10When both
HATCH_DEFAULT_KERNEL_PATH and HATCH_DEFAULT_ROOTFS_PATH are set, Hatch auto-seeds a default image with ID img_default.Path to the default root filesystem image for VMsExample:
/root/firecracker/ubuntu-noble-rootfs.ext4Must be an ext4 filesystem image compatible with your kernel.
Default number of virtual CPUs for new VMsDefault:
1Example: 2Default memory allocation in MiB for new VMsDefault:
512Example: 1024Default kernel boot arguments for VMsDefault:
console=ttyS0 reboot=k panic=1 pci=off root=/dev/vda rw rootfstype=ext4Networking
Name of the network bridge interface for VM networkingDefault:
fcbr0CIDR notation for the bridge networkDefault:
172.16.0.1/24Example: 10.0.0.1/24CIDR range allowed to access SSH forwarding portsDefault:
127.0.0.1/32 (localhost only)Example: 0.0.0.0/0 (allow all - not recommended for production)Minimum port number for SSH forwarding port rangeDefault:
16000Maximum port number for SSH forwarding port rangeDefault:
26000This range allows up to 10,000 concurrent VMs with SSH forwarding.
Idle Management
Hatch automatically pauses VMs that have been idle to save resources.Duration of inactivity before a VM is considered idle and automatically pausedDefault:
45mExample: 30m, 1h, 2h30mHow often the idle monitor checks for inactive VMsDefault:
5mExample: 15m, 10mBetter Auth (Web Application)
These variables configure the web application’s authentication system.Base URL for the Better Auth web applicationDefault:
http://localhost:3000Example: http://localhost:3000Secret key for Better Auth session encryptionExample:
replace-with-32-plus-char-secretGoogle OAuth client ID for authenticationExample:
replace-with-google-client-idRequired only if using Google OAuth for authentication.
Google OAuth client secretExample:
replace-with-google-client-secretDocker Compose Variables
These variables are used by the Docker Compose setup for infrastructure services.Cloudflare API token for DNS challenge in Let’s Encrypt certificate generation
Required for wildcard SSL certificates. See Deployment for setup details.
Email address for Let’s Encrypt certificate notificationsExample:
[email protected]PostgreSQL database userDefault:
hatchPostgreSQL database passwordDefault:
hatchPostgreSQL database nameDefault:
hatchMinIO root usernameDefault:
minioadminMinIO root passwordDefault:
minioadminExample Configuration
Here’s a complete example.env file for a production deployment: