Skip to content

nexthis/medusa-coolify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

medusa-coolify

Integration module for deploying Medusa.js projects seamlessly using Coolify.

image

πŸš€ Create PostgreSQL Database

Follow these steps to set up your PostgreSQL database:

  1. Create a PostgreSQL 16 database
    Use the default settings unless your project requires custom configuration.

  2. Enable SSL
    Ensure SSL is enabled for secure database connections. (required on medusa in production mode) image

⚑ Create Redis Database

No special configuration is required β€” simply create a Redis instance and you're good to go! image

🧩 Create medusa-server

Set up the Medusa backend service with the following steps:

1. Configure Service

Use the Coolify UI to create a new service named medusa-server.

Refer to the screenshots below for guidance:

Step 1
Step 2


2. Add Environment Variables

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?" to true for at least DATABASE_URL, WORKER_MODE and REDIS_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

🧩 Create medusa-worker

image

image

# 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?" to true for at least DATABASE_URL, WORKER_MODE and REDIS_URL.

πŸ’‘ Advice, Tips, Plans & More

Here are a few things to keep in mind when working with this setup:

  • πŸ› οΈ Using the Medusa CLI
    To run Medusa CLI commands inside the medusa-server, open the Terminal tab and run:

    node_modules/.bin/medusa <command>
  • πŸ“¦ Database Migrations
    Only the medusa-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 provided docker-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!

About

πŸš€ Seamless deployment of Medusa v2 using Coolify

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •