Prerequisites
Before you begin, ensure you have the following installed:- Node.js version 18.16.0 or higher (20.x recommended)
- pnpm version 9.0.4 or higher
- PostgreSQL version 14 or higher
- Git
- At least 4GB of RAM
- At least 10GB of free disk space
Installation
Install Node.js
Install Node.js 20.x using your package manager:Ubuntu/Debian:RHEL/CentOS/Fedora:Verify installation:
Install PostgreSQL
Install and configure PostgreSQL:Ubuntu/Debian:Create a database and user:In the PostgreSQL prompt:
Configure environment variables
Copy the example environment file:Edit the
.env file and configure the following:Install dependencies
Install all project dependencies:This may take several minutes depending on your internet connection.
Build the application
Build all packages and applications:This will:
- Generate the images domain configuration
- Build all workspace packages
- Build the API application
- Build the Client application
The build process may take 10-15 minutes depending on your server’s resources.
Start the application
Start both the API and Client servers:This runs the
start script which concurrently starts:- Client on port 3000 (or your configured
PORT_CLIENT) - API on port 8080 (or your configured
PORT_API)
The application will run in the foreground. Press
Ctrl+C to stop it. See the Process Management section below for running it as a service.Process Management
For production deployments, you should run SnailyCAD as a background service using a process manager.Using PM2
PM2 is a popular process manager for Node.js applications.Install PM2
Start with PM2
Manage with PM2
Using systemd
Alternatively, create a systemd service:Updating SnailyCAD
To update to the latest version:- Stash local changes
- Pull latest updates
- Install dependencies
- Copy environment files
- Build the application
- Start the application
Database Management
Backup Database
Restore Database
Connect to Database
Troubleshooting
Port Already in Use
Check what’s using the port:.env file if needed.
Database Connection Failed
Verify PostgreSQL is running:Build Failures
Clear the build cache and try again:Out of Memory
Increase Node.js memory limit:Next Steps
Reverse Proxy Setup
Configure nginx or Caddy for SSL and domain routing
Environment Variables
Complete environment variable reference