Deploy your own instance of Api Studio. Choose the deployment method that best fits your infrastructure.
| Requirement | Docker | Manual |
|---|---|---|
| Docker & Compose | ✅ Required | ❌ |
| Node.js 18+ | ❌ | ✅ Required |
| PostgreSQL 16+ | ✅ (Included) | ✅ Required |
| Redis 7+ | ✅ (Included) | ✅ Required |
Create a .env file in your root directory.
# === Database ===
# Connection string to your PostgreSQL database
DATABASE_URL="postgresql://user:password@localhost:5432/apiclient"
# === Authentication ===
# Generate with: openssl rand -base64 32
BETTER_AUTH_SECRET="your-secure-random-secret-key"
# The URL where the app is hosted
BETTER_AUTH_URL="http://localhost:3000"
# === Redis (Optional) ===
# For rate limiting and caching
REDIS_URL="redis://localhost:6379"
# === OAuth (Optional) ===
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""This is the recommended way to deploy Api Studio. It sets up the app, database, and Redis automatically.
Copy docker-compose.full.yml to your server.
Create your .env file as shown above.
docker-compose -f docker-compose.full.yml up -dThis will start Api Studio on port 3000.
| Action | Command |
|---|---|
| Start | docker-compose up -d |
| Stop | docker-compose down |
| Logs | docker-compose logs -f |
| Update | docker-compose pull && docker-compose up -d |
Use this if you want to manage Node.js and the database yourself (e.g., on Ubuntu).
# Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# PostgreSQL & Redis
sudo apt-get install -y postgresql postgresql-contrib redis-serversudo -u postgres psql -c "CREATE USER apiclient WITH PASSWORD 'securepass';"
sudo -u postgres psql -c "CREATE DATABASE apiclient OWNER apiclient;"git clone https://github.com/rohittiwari-dev/api-client.git
cd api-client
npm install
npm run buildsudo npm install -g pm2
pm2 start npm --name "api-studio" -- start
pm2 save| Issue | Potential Solution |
|---|---|
| Database Connection Error | Check DATABASE_URL in .env. Ensure Postgres is running and accepting connections. |
| Auth Failures | Verify BETTER_AUTH_SECRET is set and BETTER_AUTH_URL matches your domain. |
| CORS Errors | Ensure you are accessing the app from the URL defined in BETTER_AUTH_URL. |
| Build Memory Error | If building on a small VPS, increase swap space or build locally and transfer artifacts. |
Need help? Open an issue