DEV Community

Nomodo.io
Nomodo.io

Posted on • Originally published at blog.nomodo.io on

How to Develop MedusaJS Locally and Deploy Live

Prerequisites

  • Knowledge of Git and environment variables
  • Access to a Nomodo.io account

TL;DR

  1. Clone the MedusaJS repository
  2. Install dependencies and build packages
  3. Optionally link with the live instance on Nomodo
  4. Commit, push changes, and deploy your app live

Step 1: Clone the MedusaJS Repository

Go to Settings > Git Integration in your Nomodo dashboard. If you see nomodoapp/ at the start of the repository name, you previously chose deployment without GitHub integration—ask support for access.

# Clone repository
git clone https://github.com/cebreus/MyAwesome_medcs6bn6g5iopbvf9mdo80.git

# Go to project repository
cd MyAwesomeMedusa_medcs6bn6g5iopbvf9mdo80
Enter fullscreen mode Exit fullscreen mode

Example Tip: Ensure you have the correct permissions to access the repository.

Step 2: Install Dependencies and Build Packages

Install the required dependencies to run MedusaJS.

npm install
Enter fullscreen mode Exit fullscreen mode

Install dependencies, e.g. with the pnpm

Tip: For more information on configuring local development, check out the official documentation.

Step 3: Optionally Link with a Live Instance on Nomodo

To connect your local project to a live instance, go to Settings > Environment Variables in Nomodo and copy the variables into your local .env file. The Source of truth of the DB connection string is in the tab Database > Database Info.

DATABASE_URL="postgres://postgres:s3f6syra58jphm492a07ii@3.121.231.62:5432/medcs6bn6g5iopbvf9mdo80"
REDIS_URL="redis://:m5pnv313yq7fbgeuquhl91&3.121.231.62:6379"
Enter fullscreen mode Exit fullscreen mode

Example of .env file

Access Management

For security reasons, Nomodo.io blocks external requests to the database. You must add your current IP address (in CIDR format) under Database > Access Management.

  1. Choose “TCP” in the Protocol select
  2. Find your actual IP address (e.g., via ipinfo.io).
  3. Add /0 to allow access from a wide range of IPs, or use /32 to restrict access to a single IP address.
  4. Put this string into “CIDR address”
  5. In the “Port” input paste value from “DB Port” in the tab Database > Database Info.

Note: IP addresses may change over time, so ensure your current address is always updated. If you cannot connect, check if your IP is still listed.

Step 4: Run, Push, Deploy

Run your code locally using:

npm run dev
Enter fullscreen mode Exit fullscreen mode

Once your changes are ready, commit and push them to the remote repository:

git add .
git commit -m "Your message"
git push origin master
Enter fullscreen mode Exit fullscreen mode

From the Nomodo dashboard, go to Deploys and click on New Deployment.

If errors occur (such as environment variable issues), update them in Settings > Environment Variables. You may also need to run migration scripts if your changes involve modifying the database structure. Go to Database > Migrations to handle this.

If things go wrong, you can roll back to a previous working state from the deployment history.

Conclusion

Developing and deploying MedusaJS on Nomodo.io is a straightforward process, made easier with features like automatic database backups , easy environment management , and the ability to roll back deployments if needed. Whether you’re pushing small updates or significant changes requiring migrations, Nomodo.io simplifies the entire process, allowing you to focus on building your e-commerce solution without worrying about infrastructure.

Happy coding!

Try Medusa.js

Use code B0OZUUYW for a discount. We 💙 our readers.

Start Medusa.js free trial

Top comments (0)