Run StaticBackend on your own infrastructure with full control over your data and deployment.
StaticBackend is open source and free to self-host. You can deploy it on any server, cloud platform, or local machine.
You should self-host if you need:
Consider managed hosting if you:
We offer three ways to self-host, from easiest to most customizable:
Best for: Quick setup, development, production
Uses Docker Compose to run the API, PostgreSQL, and Redis with one command. No manual configuration needed.
Best for: Lightweight deployments, specific OS requirements
Download a ready-to-run binary for Linux, macOS, or Windows. You manage the database and Redis separately.
Best for: Contributing to the project, custom modifications
Clone the repository and build with Go. Full control and customization.
The fastest way to get StaticBackend running. Everything is included.
git clone https://github.com/staticbackendhq/core.git
cd core
Copy the demo environment file:
cp .demo.env .env
The defaults work for local development. For production, update .env with your own secrets and service URLs.
If you have make:
make docker
Otherwise:
docker build . -t staticbackend:latest
docker compose -f docker-compose-demo.yml up
If your Docker installation still uses the older Compose command, run:
docker-compose -f docker-compose-demo.yml up
StaticBackend is now running at http://localhost:8099.
Save these credentials. You’ll need them to connect your app.
The Docker setup includes:
Download a pre-built binary and run it with your own database and Redis services.
Get the latest release for your OS: GitHub Releases
Available for:
Option A: Use Docker for services only
PostgreSQL and Redis:
docker compose up
MongoDB and Redis:
docker compose -f docker-compose-mongo.yml up
Use docker-compose instead of docker compose if your Docker installation requires it.
Option B: Install natively
Install PostgreSQL or MongoDB and Redis on your system. Refer to their official documentation.
Create a .env file with your settings:
APP_ENV=dev
APP_SECRET=a-very-long-random-key
APP_URL=http://localhost:8099
# PostgreSQL with the provided docker-compose.yml service
DATABASE_URL=host=localhost user=postgres password=postgres dbname=sb sslmode=disable
DATA_STORE=pg
# Or MongoDB:
# DATABASE_URL=mongodb://localhost:27017
# DATA_STORE=mongo
# Or SQLite:
# DATABASE_URL=dev.db
# DATA_STORE=sqlite
JWT_SECRET=another-long-random-key
# Redis can be configured with REDIS_URL or REDIS_HOST/REDIS_PASSWORD.
REDIS_HOST=localhost:6379
REDIS_PASSWORD=
# REDIS_URL=redis://localhost:6379
MAIL_PROVIDER=dev
FROM_EMAIL=you@domain.com
FROM_NAME=Your Name
STORAGE_PROVIDER=local
LOCAL_STORAGE_URL=http://localhost:8099
For a quick local-only process without external services, use the in-memory providers:
DATABASE_URL=mem
DATA_STORE=mem
REDIS_HOST=mem
Make the binary executable on Linux or macOS:
chmod +x staticbackend
./staticbackend
Windows:
staticbackend.exe
StaticBackend is now running at http://localhost:8099.
Follow the same process as Docker setup to create your first app.
Build StaticBackend from source for complete control.
git clone https://github.com/staticbackendhq/core.git
cd core
Create your .env file. You can start from .demo.env for the Docker demo, .local.env for local development, or use the Binary Setup example above.
Use Docker for PostgreSQL and Redis:
docker compose up
Or use Docker for MongoDB and Redis:
docker compose -f docker-compose-mongo.yml up
You may also install PostgreSQL, MongoDB, SQLite, or Redis natively.
With make on Linux or macOS:
make start
Or manually:
cd cmd
go build -o staticbackend
./staticbackend
Windows:
cd cmd
go build -o staticbackend.exe
staticbackend.exe
Update your .env file for production:
APP_ENV=production
APP_SECRET=your-long-random-app-secret
APP_URL=https://api.yourdomain.com
JWT_SECRET=your-long-random-jwt-secret
DATABASE_URL=your-production-db-url
DATA_STORE=pg
REDIS_URL=redis://user:password@redis-host:6379
MAIL_PROVIDER=ses
FROM_EMAIL=you@domain.com
FROM_NAME=Your Name
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
STORAGE_PROVIDER=s3
S3_ACCESSKEY=your-access-key
S3_SECRETKEY=your-secret-key
S3_ENDPOINT=s3.amazonaws.com
S3_REGION=us-east-1
S3_BUCKET=your-bucket-name
S3_CDN_URL=https://your-cdn-url.com
The ses mail provider uses the AWS SDK credential chain, so AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are the simplest environment variables for a self-hosted server. StaticBackend also uses S3_REGION as the SES region.
For S3-compatible providers such as DigitalOcean Spaces or MinIO, set S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESSKEY, S3_SECRETKEY, and S3_CDN_URL for that provider.
# Use Mailpit instead of terminal-only dev email output.
MAIL_PROVIDER=local
MAILPIT_SMTP_ADDR=localhost:1025
MAILPIT_API_URL=http://localhost:8025
# Put the full-text search index on persistent storage.
FTS_INDEX_FILE=/var/lib/staticbackend/sb.fts
# If you run more than one instance, only the primary runs scheduled jobs.
PRIMARY_INSTANCE_HOSTNAME=server1.yourdomain.com
# Write logs to a file and control console verbosity.
LOG_FILENAME=/var/log/staticbackend.log
LOG_CONSOLE_LEVEL=info
# Load compiled plugins from a specific directory.
PLUGINS_PATH=/opt/staticbackend/plugins
Before deploying to production:
APP_SECRET and JWT_SECRETAPP_URL to the public backend URLFTS_INDEX_FILE and local uploads on persistent storage if neededStaticBackend runs anywhere Go applications run:
Install the CLI to manage your instance:
npm install -g @staticbackend/cli
Create a .backend.yml file in your project:
region: dev
Create an account:
backend account create your@email.com
Manage your database, users, and functions via CLI commands.
To update your self-hosted instance:
git pulldocker build . -t staticbackend:latest or recompiledocker compose restart or restart the binaryUse docker-compose restart if your Docker installation requires the older command.
Need simpler setup? Try managed hosting - same features, zero DevOps.
© 2023 Focus Centric Inc. All rights reserved.