Deploying MERP25 ERP to Render.com (Manual Setup)¶
This guide walks you through manually deploying the MERP25 ERP system to Render as separate services.
Prerequisites¶
- Render Account: Sign up at render.com
- GitHub Repository: Your code should be pushed to a GitHub repository
- Database: PostgreSQL database (e.g. Supabase, Railway, or Render PostgreSQL)
- Media Storage: Since Render filesystems are ephemeral, you must configure external storage (like AWS S3) for production, or accept that uploaded files (including generated PDFs) will be lost on restart.
1. Environment Setup (Critical for FileField)¶
MERP25 uses Django's FileField to store generated PDFs and user uploads. On ephemeral platforms like Render, the local filesystem is wiped on every deploy/restart.
Option A: Persistent Disk (Render Only)¶
If using Render, you can attach a Persistent Disk to your Web Service.
1. In Render Dashboard, go to your Web Service -> Disks.
2. Click Add Disk.
3. Name: merp25-media
4. Mount Path: /var/lib/data (or your preferred path)
5. Size: 1GB (start small)
Update settings.py:
You must tell Django to use this path for MEDIA_ROOT.
MEDIA_ROOT to /var/lib/data.
Option B: Simple "Create on Start" (Non-Persistent)¶
If you don't need long-term retention of these files (e.g. just for immediate download), you can ensure the directory exists on startup.
Update build.sh or start.sh:
Add this line before starting Gunicorn:
2. Deploy Backend (Web Service)¶
2.1 Create New Web Service¶
- Go to Render Dashboard
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Configure the service:
- Name:
merp25-backend - Runtime:
Python 3 - Build Command:
./build.sh - Start Command:
gunicorn config.wsgi:application
2.2 Set Environment Variables¶
| Variable | Value | Description |
|---|---|---|
DATABASE_URL |
postgresql://... |
Connection string |
DEBUG |
False |
Production mode |
SECRET_KEY |
... |
Random string |
ALLOWED_HOSTS |
.onrender.com |
Hostname |
3. Deploy Frontend (Static Site)¶
- "New +" → "Static Site"
- Build Command:
npm install && npm run build - Publish Directory:
dist - Environment Variables:
VITE_API_URL: URL of your backend service (e.g.https://merp25-backend.onrender.com)VITE_SUPABASE_ANON_KEY: Supabase anon keyVITE_SUPABASE_URL: Supabase URL