Skip to content

Self-hosted

Run instancez on a bare metal server or VPS with inz serve.

Terminal window
curl -fsSL https://get.instancez.ai | sh

This installs inz to ~/.local/bin. Verify the install:

Terminal window
inz version

Alternatively, download a release binary directly from GitHub Releases and place it on your PATH.

Create a .production.env file next to instancez.yaml. inz serve loads this file automatically when the config source is a local file. Shell environment variables always take precedence over values in .production.env.

Terminal window
# .production.env — do not commit this file
INSTANCEZ_DATABASE_URL=postgres://postgres:password@localhost:5432/mydb
INSTANCEZ_PUBLISHABLE_KEY=inz_publishable_your-key
INSTANCEZ_SECRET_KEY=inz_secret_your-key

Roles (instancez_owner, authenticator, anon, authenticated, service_role) are provisioned automatically by instancez on first startup.

See Environment Variables for the full list of available variables.

Before deploying a config change, check it for errors:

Terminal window
inz validate

This runs a structural check on instancez.yaml without connecting to the database. Fix any reported errors before restarting the server.

Terminal window
inz serve --migrate

--migrate applies pending schema migrations on startup. Drop it if you manage migrations separately. The server listens on port 8080 by default; set INSTANCEZ_PORT or --port to change it.

On startup, inz serve logs a JSON stream to stdout. The server is ready when you see "listening".

EndpointBehaviour
GET /liveReturns 200 when the process is alive
GET /healthReturns 200 when the app is initialized
GET /readyReturns 200 when Postgres is reachable; 503 otherwise

Use /ready for load-balancer health checks. Configure Nginx to check it before routing traffic:

location /ready {
proxy_pass http://127.0.0.1:8080/ready;
access_log off;
}