Infrastructure Commands
Infrastructure commands manage SSL certificates, local DNS entries, and Docker containers. These tools ensure your local development environment mirrors production as closely as possible.
SSL Commands
FORGE uses mkcert to generate locally-trusted SSL certificates, enabling HTTPS during development without browser warnings.
forge ssl:install
Install mkcert and its local certificate authority (CA).
forge ssl:installThis command installs mkcert via Homebrew (macOS), Chocolatey (Windows), or your system package manager (Linux), then runs mkcert -install to register the local CA in your trust store.
TIP
You only need to run ssl:install once per machine. FORGE will remind you if mkcert is missing when you run forge new.
forge ssl:generate
Generate SSL certificates for one or more domains.
forge ssl:generate [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--domains | string | Project domains | Comma-separated list of domains to include in the certificate. |
Example
forge ssl:generate --domains="myapp.local,api.myapp.local,admin.myapp.local"Generated files are placed in the project's certs/ directory:
certs/
myapp.local.pem
myapp.local-key.pemforge ssl:trust
Re-register the local CA in your system trust store. Useful after OS upgrades or trust store resets.
forge ssl:trustHosts Commands
FORGE can manage /etc/hosts entries so local domains resolve to 127.0.0.1 without external DNS.
forge hosts:add
Add a domain entry to /etc/hosts.
forge hosts:add [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--domain | string | — | Domain to add, e.g. myapp.local. |
WARNING
This command requires elevated privileges. FORGE will prompt for sudo access on macOS/Linux or Administrator rights on Windows.
Example
forge hosts:add --domain=myapp.local
forge hosts:add --domain=api.myapp.local
forge hosts:add --domain=admin.myapp.localforge hosts:list
List all FORGE-managed entries currently in /etc/hosts.
forge hosts:listExample Output
FORGE hosts entries:
127.0.0.1 myapp.local
127.0.0.1 api.myapp.local
127.0.0.1 admin.myapp.localforge hosts:remove
Remove a previously added domain from /etc/hosts.
forge hosts:remove --domain=myapp.localDocker Commands
FORGE generates a Docker Compose configuration with profiles for different service combinations. Docker commands wrap docker compose with project-aware defaults.
Docker Profiles
FORGE organizes services into Docker Compose profiles:
| Profile | Services Included |
|---|---|
db | PostgreSQL, Redis |
api | Rust API server |
web | Next.js web frontend |
admin | Next.js admin frontend |
all | Every service |
Profiles allow you to start only the services you need. For example, you might run db in Docker while developing the API locally.
forge docker:up
Start Docker containers.
forge docker:up [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
-d | flag | false | Run containers in detached (background) mode. |
--build | flag | false | Rebuild images before starting. |
--ssl | flag | false | Enable the Nginx SSL reverse proxy. |
--apps | string | all | Comma-separated profiles to start, e.g. db,api. |
Examples
# Start everything in the background
forge docker:up -d
# Start only the database
forge docker:up -d --apps=db
# Rebuild and start with SSL
forge docker:up -d --build --sslforge docker:down
Stop and remove Docker containers.
forge docker:down [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
-v | flag | false | Also remove named volumes (database data, caches). |
DANGER
The -v flag deletes persistent volumes including the PostgreSQL data directory. All database data will be lost.
forge docker:logs
View container logs.
forge docker:logs [OPTIONS] [SERVICE]| Option | Type | Default | Description |
|---|---|---|---|
-f | flag | false | Follow log output in real time. |
SERVICE | string | — | Optional service name to filter logs, e.g. api, web, postgres. |
Examples
# Follow API logs
forge docker:logs -f api
# View all logs (last 100 lines)
forge docker:logsforge docker:shell
Open an interactive shell inside a running container.
forge docker:shell <SERVICE>Example
# Open a shell in the API container
forge docker:shell api
# Open a psql session in the database container
forge docker:shell postgresCommon Workflows
First-time local setup:
forge ssl:install
forge new --name myapp
# SSL and hosts are configured automatically during project creation
forge docker:up -dRestart with a clean database:
forge docker:down -v
forge docker:up -d
forge migrate:fresh --seedAdd a new local domain:
forge ssl:generate --domains="myapp.local,api.myapp.local,admin.myapp.local,docs.myapp.local"
forge hosts:add --domain=docs.myapp.local
forge docker:up -d --build --sslSee Also
- Project Commands —
forge newconfigures SSL, hosts, and Docker automatically - Development Commands — run services locally or via Docker
- Deployment Commands — production Docker and Kubernetes deployments