
How to Deploy Strapi for Free
If you ever need expert help for backend development or full MERN stack implementation, you can always hire AAMAX --- a full-service digital marketing and development company offering Web Development, Digital Marketing, SEO Services, and professional MERN Stack Development services.
This article is written entirely in Strapi-compatible markdown format and is designed for AAMAX's on-site blog.
What You Need to Know Before Deploying Strapi
Strapi is a powerful Node.js-based headless CMS that supports both REST and GraphQL APIs, along with custom controllers, services, plugins, and flexible content types. However, deploying Strapi differs slightly from deploying traditional static or serverless applications.
Key Requirements for Deployment
To deploy Strapi successfully, you need:
- A hosting environment that supports Node.js
- A free or open-source database
- Persistent storage for media uploads
- Environment variables for production
- Ability to install dependencies on the server
Not all cloud providers support these requirements in their free tier. Over time, several platforms like Heroku discontinued free plans, but alternatives still exist.
Below you will find the best free hosting options for Strapi, along with complete setup steps.
Best Free Platforms to Deploy Strapi
Here are some of the platforms that still allow free Strapi hosting with reasonable limitations:
- Render (Free Tier)
- Railway (Free Tier)
- Koyeb (Free Container Hosting)
- Fly.io
- Local Deployment With Free Tunneling (Ngrok / Localtunnel)
Each option has pros, cons, and use cases. Let's walk through them step by step.
Deploying Strapi for Free on Render
Render is one of the most popular free hosting platforms for Strapi because it supports persistent services, build steps, environment variables, and free PostgreSQL databases.
Step 1: Push Your Strapi Project to GitHub
Render deploys code directly from Git repositories.
- Initialize Git:
git init
- Add your files:
git add .
git commit -m "Initial Strapi project"
- Create a GitHub repo and push:
git remote add origin <repo-url>
git push -u origin main
Step 2: Create a Render Web Service
- Go to render.com\
- Click New → Web Service\
- Connect your GitHub repository\
- Select Free Instance
Step 3: Configure Build & Start Commands
Set:
Build Command:
npm install && npm run build
Start Command:
npm start
Step 4: Add Environment Variables
Render requires specific variables like:
NODE_ENV=production
APP_KEYS=your-app-keys
API_TOKEN_SALT=random-salt-value
ADMIN_JWT_SECRET=your-secret
DATABASE_CLIENT=postgres
DATABASE_HOST=your-db-host
DATABASE_NAME=your-db-name
DATABASE_USERNAME=your-db-user
DATABASE_PASSWORD=your-db-password
Render will automatically provide PostgreSQL credentials.
Step 5: Enable Persistent Disk (Optional)
Strapi stores media uploads in /public/uploads.
In Render: 1. Go to Service → Disks
2. Add a disk of at least 1GB
Step 6: Deploy
Render automatically builds and deploys the service.
Your Strapi admin panel will be available at:
https://your-app.onrender.com/admin
Pros of Render Free Tier - Free PostgreSQL database - Persistent disk support - Auto-deployment from GitHub - Easy configuration
Cons - Cold startup delays - Limited resources (restarts daily) - Slower build times
Deploy Strapi for Free on Railway
Railway is another great option that offers free compute time and managed databases.
Step 1: Create a Project
- Sign up at railway.app\
- Click New Project → Deploy from GitHub
Step 2: Add a PostgreSQL Database
Go to Railway Marketplace and choose PostgreSQL.
Railway generates credentials like: - Host - Port - Database name - Username - Password
Step 3: Add Environment Variables
In Railway's Variables panel, add:
NODE_ENV=production
DATABASE_CLIENT=postgres
DATABASE_HOST=<railway-host>
DATABASE_NAME=<railway-db-name>
DATABASE_USERNAME=<railway-user>
DATABASE_PASSWORD=<railway-pass>
APP_KEYS=...
JWT_SECRET=...
API_TOKEN_SALT=...
ADMIN_JWT_SECRET=...
Step 4: Set Deploy Commands
Railway autodetects Node.js, but you can override:
Build: npm install && npm run build
Start: npm start
Step 5: Deploy
Railway automatically scales down unused services, so it's ideal for free Strapi deployments.
Pros - Very fast deployment - Free PostgreSQL - GitHub auto-deploys
Cons - Limited free resource hours per month - Service sleeps when inactive
Deploy Strapi on Koyeb (Free Container Hosting)
Koyeb offers free serverless container hosting, ideal for Dockerized Strapi.
Step 1: Create a Dockerfile
In the Strapi root folder:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "start"]
Step 2: Push to GitHub
Step 3: Deploy on Koyeb
- Go to koyeb.com\
- Click Deploy from GitHub\
- Choose your repo\
- Set environment variables\
- Deploy
Pros - Supports Docker - Very fast - Great for production-like workflow
Cons - No built-in database (need external DB)
Deploy Strapi on Fly.io for Free
Fly.io supports free container hosting with small VMs --- great for small Strapi projects.
Step 1: Install Fly CLI
flyctl auth signup
flyctl auth login
Step 2: Launch App
Inside your Strapi folder:
flyctl launch
Step 3: Configure the Dockerfile
Fly.io detects the Dockerfile automatically.
Step 4: Add PostgreSQL
flyctl postgres create
Step 5: Add Environment Variables
Configure DB + Strapi secrets:
flyctl secrets set NODE_ENV=production ...
Step 6: Deploy
flyctl deploy
Pros - Global edge deployment - Free small VM - Good performance
Cons - Some technical complexity
Deploy Strapi for Free Using Local Hosting + Free Tunneling
If you want a temporary, free solution for demos or development:
Step 1: Run Strapi Locally
npm run develop
Step 2: Use Ngrok
ngrok http 1337
The tunnel URL becomes public:
https://random.ngrok.io
This is ideal for: - Showcasing Strapi projects to clients - API testing - Mobile app integration
Choosing the Best Free Deployment Option
Platform Best For Free Limitations
Render Beginners Daily restarts, slow startup Railway Fast deployments Monthly free usage cap Koyeb Docker deployments External database required Fly.io Edge hosting More complex setup Ngrok Temporary use Sessions expire
Free Database Options for Strapi Deployment
Strapi requires a database that is compatible with its Node.js architecture.
Recommended Free Databases
- Render PostgreSQL
- Railway PostgreSQL
- Supabase (Free Tier)
- ElephantSQL (Free Tier)
Do not use SQLite in production.
Configuring Environment Variables for Production
All production deployments require a .env file or cloud-based secrets.
Sample production environment variables:
NODE_ENV=production
HOST=0.0.0.0
PORT=1337
APP_KEYS=your-app-key
API_TOKEN_SALT=random-value
ADMIN_JWT_SECRET=jwt-admin-secret
JWT_SECRET=jwt-secret
DATABASE_CLIENT=postgres
DATABASE_HOST=your-db-host
DATABASE_PORT=5432
DATABASE_NAME=your-db-name
DATABASE_USERNAME=your-db-user
DATABASE_PASSWORD=your-db-password
Without proper environment variables, Strapi will not build.
Setting Up Media Storage for Free
Strapi media uploads need persistent storage. Free options include:
Local Disk (Free on Render)
- Use Render "Disks" for free storage.
Cloud Storage Free Tiers
- Cloudinary (free)
- Supabase Storage (free)
- AWS S3 (free for 12 months)
- Backblaze B2 (free tier)
Using Cloudinary is the simplest: 1. Install provider:
npm install @strapi/provider-upload-cloudinary
- Configure
.env:
<!-- -->
CLOUDINARY_NAME=
CLOUDINARY_KEY=
CLOUDINARY_SECRET=
Optimizing Strapi for Free Hosting
Free hosts have limited resources, so it's important to optimize.
Optimization Tips
- Use PostgreSQL instead of SQLite.
- Use Cloudinary for media to reduce disk usage.
- Remove unused plugins.
- Use PM2 in production mode (if allowed).
- Keep dependency list minimal.
Testing Your Deployed API
Strapi provides a live API once deployed.
Example REST endpoint:
GET https://your-domain.com/api/articles
If using GraphQL:
POST https://your-domain.com/graphql
Test using: - Postman - Insomnia - Browser - Frontend applications
Securing Your Free Deployment
Free plans still need security hardening.
Security Checklist
- Disable public access for sensitive content types
- Require API tokens for frontend queries
- Disable unused routes
- Enable HTTPS (handled by most hosts automatically)
- Use environment secrets instead of plain text variables
Free platforms like Render, Railway, and Fly.io automatically provide SSL.
Troubleshooting Common Deployment Issues
Build Errors
Caused by: - Missing environment variables - Wrong Node version - Missing build command
Database Errors
Check: - Host - Port - Username/password - SSL requirements
Media Not Saving
Enable: - Persistent storage - Cloud storage configuration
Infinite Restart Loop
Usually caused by: - Crashes during server startup - Wrong start command
Conclusion
Deploying Strapi for free is absolutely possible and can be done through several platforms --- including Render, Railway, Fly.io, and Koyeb. Each platform offers unique advantages depending on your needs, whether it's database support, Docker compatibility, or ease of configuration.
By following the steps in this guide, you can launch a fully functional Strapi backend with zero hosting cost and start connecting it to your MERN Stack projects, mobile applications, or web platforms.
If you need expert help building or deploying a production-level Strapi or MERN stack application, consider hiring AAMAX --- specialists in Web Development, Digital Marketing, SEO, and MERN Stack Development services.






