Prerequisites
Before you begin, make sure you have:Node.js
Version 18.16.0 or higher
PostgreSQL
Version 12 or higher
pnpm
Version 9.0.4 (package manager)
Git
For cloning the repository
Installation Methods
Choose the installation method that works best for your setup:Docker Installation
Recommended for most users. Easiest setup with containers.
Standalone Installation
Install directly on your server without Docker.
Quick Start (Docker)
The fastest way to get started is using Docker Compose.Generate Security Tokens
JWT_SECRET: Any random string of charactersENCRYPTION_TOKEN: Must be exactly 32 characters. Generate at CodeBeautify
Start with Docker Compose
- Pull the necessary Docker images
- Set up PostgreSQL database
- Build and start the API and client
The first user to register will automatically become the owner with full administrative permissions.
Quick Start (Standalone)
For installation without Docker:Environment Variables Reference
Key environment variables you must configure:Database Configuration
| Variable | Description | Example |
|---|---|---|
POSTGRES_PASSWORD | Database password | mySecurePassword123 |
POSTGRES_USER | Database username | postgres |
POSTGRES_DB | Database name | snaily-cad-v4 |
DB_HOST | Database host | localhost or postgres (Docker) |
DB_PORT | Database port | 5432 |
Security Tokens
| Variable | Description | Example |
|---|---|---|
JWT_SECRET | Random secret for JWT tokens | my-super-secret-key-123 |
ENCRYPTION_TOKEN | 32-character encryption key | Geu2WGypP7irbwa3tCeeKS6YiyluFLep |
Application URLs
| Variable | Description | Example |
|---|---|---|
CORS_ORIGIN_URL | Client URL for CORS | http://192.168.1.100:3000 |
NEXT_PUBLIC_CLIENT_URL | Public client URL | http://192.168.1.100:3000 |
NEXT_PUBLIC_PROD_ORIGIN | API URL | http://192.168.1.100:8080/v1 |
Optional Configuration
| Variable | Description | Default |
|---|---|---|
PORT_API | API server port | 8080 |
PORT_CLIENT | Client server port | 3000 |
DOMAIN | Domain (for SSL) | (empty) |
SECURE_COOKIES_FOR_IFRAME | Enable secure cookies | false |
For a complete environment variables reference, see the Environment Variables Configuration page.
Post-Installation Steps
Create Admin Account
Navigate to
http://your-ip:3000 and register the first account. This account will automatically have owner permissions.Configure CAD Settings
Go to Admin → Manage → CAD Settings to:
- Set your CAD name
- Configure enabled features
- Set up registration requirements
- Configure authentication options
Create Values
Set up basic values in Admin → Manage → Values:
- Departments (Police, Sheriff, Fire, EMS)
- Vehicle types and models
- Penal codes
- License types
Development Installation
For local development with hot-reload:- Starts PostgreSQL in Docker
- Runs all packages and apps in watch mode
- Enables hot-reload for development
Development mode runs on parallel processes and watches for file changes automatically.
Verification
Verify your installation is working:Check API Status
Check API Status
Visit
http://your-ip:8080/v1 - you should see API version infoCheck Client Status
Check Client Status
Visit
http://your-ip:3000 - you should see the login pageCheck Database Connection
Check Database Connection
If using Docker:Look for “database system is ready to accept connections”
Check Application Logs
Check Application Logs
If using Docker:
Common Issues
Connection Refused Error
Connection Refused Error
Make sure PostgreSQL is running and accessible:
- Check
DB_HOSTandDB_PORTare correct - Verify PostgreSQL is accepting connections
- Check firewall rules
Port Already in Use
Port Already in Use
Change the ports in Remember to update
.env:NEXT_PUBLIC_PROD_ORIGIN to match the new API port.ENCRYPTION_TOKEN Error
ENCRYPTION_TOKEN Error
Ensure your
ENCRYPTION_TOKEN is exactly 32 characters long. Generate a new one at CodeBeautify.Database Migration Errors
Database Migration Errors
Reset the database (WARNING: deletes all data):
Next Steps
Configure Environment Variables
Learn about all available configuration options
Set Up Integrations
Connect Discord, FiveM, and other services
User Guides
Learn how to use each module
Reverse Proxy Setup
Set up SSL with Nginx or Apache
Getting Help
If you encounter issues during installation:- Check the Troubleshooting Guide
- Join our Discord community
- Search GitHub Issues
- Review the complete documentation
For production deployments, we strongly recommend using a reverse proxy (Nginx/Apache) with SSL certificates for security.