The setup script is the recommended way to self-host Bigcapital for most users.
It handles all the complexity of Docker deployment through a simple interactive menu.
Prerequisites
Before running the setup script, ensure you have the following installed on your server:- Docker (latest version)
- Docker Compose (either
docker-composeordocker composeplugin) - Git
- curl
Download the Setup Script
Download the setup script from the Bigcapital repository:Using the Setup Script
Run the setup script interactively:| Action | Description |
|---|---|
install | Download Docker files and pull images |
start | Start all Bigcapital services |
stop | Stop all Bigcapital services |
restart | Restart all Bigcapital services |
upgrade | Upgrade to the latest version |
logs | View logs for specific services |
Interactive Menu
When you run./setup.sh without arguments, you’ll see an interactive menu:
Installation Steps
1. Install
Select option1 or run:
- Clone the latest Docker configuration files from the repository
- Create an
.envfile from the example configuration - Pull the latest Docker images from GitHub Container Registry
- Archive any existing configuration files (stored in
./archive/)
2. Configure Environment Variables
Before starting the services, edit the.env file to configure your deployment:
- Mail settings (
MAIL_HOST,MAIL_USERNAME,MAIL_PASSWORD, etc.) - JWT_SECRET (generate a strong random value)
- Database passwords (change default passwords for security)
3. Start Services
Select option2 or run:
- Build and start all Docker containers
- Wait for database migrations to complete
- Wait for the API server to be ready
- Display the access URL
The default access URL is
http://localhost:8000 unless you configured a
different BASE_URL in the .env file.4. Create Your First Account
Navigate to the displayed URL in your browser and create your first account. No default account is provided.Managing Services
Stop Services
Restart Services
View Logs
- Webapp
- API (Server)
- Migration
- Envoy Proxy
- MariaDB
Upgrading Bigcapital
To upgrade to the latest version:- Stop all running services
- Download the latest Docker configuration files
- Pull the latest images from the registry
What the Script Does
The setup script automates the following components:File Management
File Management
Downloads the
docker/ directory, docker-compose.prod.yml, and
.env.example from the Bigcapital repository. Existing files are archived
with timestamps in the ./archive/ directory.Environment Setup
Environment Setup
Automatically creates an
.env file from .env.example if one doesn’t
exist. You’ll need to edit this file to configure mail settings and
security credentials.Container Orchestration
Container Orchestration
Detects whether your system uses
docker-compose (legacy) or
docker compose (plugin) and uses the appropriate command.Migration Monitoring
Migration Monitoring
During startup, the script monitors the database migration container and
waits for migrations to complete before reporting success.
Health Checks
Health Checks
Verifies that the API server starts successfully and listens on the
configured port. If migrations fail, the script stops services and
displays an error message.
Troubleshooting
Database Migration Fails
If you see “Bigcapital Server failed to start” during startup:- Check migration logs:
./setup.sh logs→ Select option 3 - Fix any configuration issues in
.env - Stop services:
./setup.sh stop - Start again:
./setup.sh start
Port Already in Use
If port 8000 is already in use, edit the.env file and change the PORT variable, or stop the conflicting service.