Integration module for deploying Medusa.js projects seamlessly using Coolify.
Follow these steps to set up your PostgreSQL database:
-
Create a PostgreSQL 16 database
Use the default settings unless your project requires custom configuration. -
Enable SSL
Ensure SSL is enabled for secure database connections. (required on medusa in production mode)
No special configuration is required β simply create a Redis instance and you're good to go!
Set up the Medusa backend service with the following steps:
Use the Coolify UI to create a new service named medusa-server
.
Refer to the screenshots below for guidance:
Use the Coolify environment UI to set the following variables:
# Secrets (generate securely, e.g. `openssl rand -hex 32`)
COOKIE_SECRET=supersecret
JWT_SECRET=supersecret2
# CORS settings
STORE_CORS=https://front.site.com
ADMIN_CORS=https://admin.site.com
AUTH_CORS=https://admin.site.com,https://front.site.com
# Backend configuration
BACKEND_URL=https://admin.site.com
DISABLE_ADMIN=false
WORKER_MODE=server
PORT=9000
# Database connections
DATABASE_URL=postgres://user:password@host:port/database
REDIS_URL=redis://user:password@host:port/database
β οΈ Important:
Make sure to set "Build Variable?" totrue
for at leastDATABASE_URL
,WORKER_MODE
andREDIS_URL
.
π For more information
To better understand how the Medusa server and worker setup works, visit the official documentation:
π https://docs.medusajs.com/learn/deployment
# Secrets (generate securely, e.g. `openssl rand -hex 32`)
COOKIE_SECRET=supersecret
JWT_SECRET=supersecret2
# CORS settings
STORE_CORS=https://front.site.com
ADMIN_CORS=https://admin.site.com
AUTH_CORS=https://admin.site.com,https://front.site.com
# Backend configuration
BACKEND_URL=https://admin.site.com
DISABLE_ADMIN=true
WORKER_MODE=worker
PORT=9000
# Database connections
DATABASE_URL=postgres://user:password@host:port/database
REDIS_URL=redis://user:password@host:port/database
β οΈ Important:
Make sure to set "Build Variable?" totrue
for at leastDATABASE_URL
,WORKER_MODE
andREDIS_URL
.
Here are a few things to keep in mind when working with this setup:
-
π οΈ Using the Medusa CLI
To run Medusa CLI commands inside themedusa-server
, open the Terminal tab and run:node_modules/.bin/medusa <command>
-
π¦ Database Migrations
Only themedusa-server
is responsible for running database migrations. -
π S3/File Storage Not Configured
This setup does not include S3 or file storage integration by default.
If needed, you'll need to configure it yourself β fortunately, itβs quite simple! -
π§ͺ Development Workflow (Optional)
For local development, you can use the provideddocker-compose.yaml
and fill/medusa/.env
.
Start the services and run:yarn run dev
π¬ Not sure if this is the optimal dev workflow β feel free to share your thoughts!
π That's all for now β until next time!