Production Setup
This document outlines the steps required to set up OsmoX for production. Following these steps will ensure that your application is configured properly for a production environment.Prerequisites
Node.js v20.x+
Install via NVM
PostgreSQL v16.x+
Production database server
Redis v6.x+
Queue backend
PM2 v5.x+
Process manager for Node.js
Docker v26.1.2
Container runtime (optional)
Git v2.x+
Version control
Environment Configuration
Create the.env file with production values:
| Variable | Description |
|---|---|
NODE_ENV | Set to production |
SERVER_PORT | API server port |
DB_HOST | PostgreSQL host |
DB_PORT | PostgreSQL port |
DB_USERNAME | Database username |
DB_PASSWORD | Database password |
REDIS_HOST | Redis host |
REDIS_PORT | Redis port |
API_KEY_SECRET | Secret for API key encryption |
JWT_SECRET | Secret for JWT tokens |
Build the Application
Before starting the server, build OsmoX:Deployment Options
- PM2
- Docker
PM2 Deployment
1. Create PM2 ConfigurationCreate anecosystem.config.js file:Updating Environment Variables
If you need to update environment variables in a Docker deployment:1
Update .env file
Modify the values in your
.env file2
Stop containers
3
Rebuild containers
4
Start containers
Next Steps
Usage Guide
Learn how to make API calls and send notifications