Migrating from Heroku: A Step-by-Step Guide for Indie Developers
Heroku's price changes got you sweating? You're not alone. Thousands of developers are looking for alternatives that won't break the bank while still keeping deployments simple. The good news? Migrating away from Heroku doesn't have to be a nightmare.
Whether you're an AI-assisted builder who just wants to ship without DevOps headaches, or a solopreneur watching hosting costs eat into your revenue, this guide will walk you through your migration options and the actual steps to make the switch.
Why Developers Are Leaving Heroku
Let's be real - Heroku was great when it was affordable. But the pricing changes hit indie developers hard:
- Free tier elimination: No more free dynos for testing and small projects
- Minimum $7/month per app: Adds up fast when you have multiple projects
- Database costs: Even basic Postgres plans are pricey
- Limited resources: You pay premium prices for basic specs
For AI-assisted builders who iterate quickly and run multiple experiments, these costs can spiral out of control fast.
Top Heroku Alternatives for Vibe Coders
Railway
Best for: Simplicity with better pricing
# Deploy with Railway CLI
npm install -g @railway/cli
railway login
railway deploy
Railway offers Heroku-like simplicity with:
- $5/month starter plan with generous usage
- Automatic deployments from Git
- Built-in databases and Redis
- Zero-config deployments for most frameworks
Render
Best for: Static sites and web services
Render provides:
- Free tier for static sites
- $7/month for web services (but better specs than Heroku)
- Automatic SSL and CDN
- Native Docker support
DigitalOcean App Platform
Best for: Scaling beyond hobby projects
- $5/month basic plan
- Built on reliable DO infrastructure
- One-click database add-ons
- Integrated monitoring
Managed Services (Like DeployMyVibe)
Best for: Developers who want zero DevOps
Managed deployment services handle the entire migration for you:
- Expert migration assistance
- Optimized hosting configurations
- Ongoing maintenance and monitoring
- Custom domains and SSL handled automatically
Step-by-Step Migration Process
Phase 1: Audit Your Current Setup
Before touching anything, document what you have:
# List all your Heroku apps
heroku apps
# Check app configuration
heroku config -a your-app-name
# Review add-ons
heroku addons -a your-app-name
Create a migration checklist:
- Environment variables
- Database (Postgres, Redis, etc.)
- Custom domains
- SSL certificates
- Background jobs/workers
- File storage (S3, Cloudinary, etc.)
- Email services
- Monitoring and logging
Phase 2: Prepare Your Application
Most Heroku apps need minimal changes, but check these:
Port Configuration
// Make sure your app uses the PORT environment variable
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
Database URLs
// Use DATABASE_URL or connection string format
const db = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: process.env.NODE_ENV === 'production' ? { rejectUnauthorized: false } : false
});
Build Scripts Ensure your package.json has proper build and start scripts:
{
"scripts": {
"build": "npm run build:css && npm run build:js",
"start": "node server.js",
"dev": "nodemon server.js"
}
}
Phase 3: Set Up Your New Platform
For Railway:
- Connect your GitHub repo
- Add environment variables in the dashboard
- Deploy automatically triggers on push
For Render:
- Connect repository
- Configure build and start commands
- Set up environment variables
- Deploy
For Managed Services:
- Provide repository access
- Share environment variables securely
- Let the service handle deployment configuration
- Review and approve the setup
Phase 4: Database Migration
This is the trickiest part, but manageable:
Export from Heroku Postgres:
# Create a backup
heroku pg:backups:capture -a your-app-name
# Download the backup
heroku pg:backups:download -a your-app-name
Import to new platform:
# For PostgreSQL
pg_restore --verbose --clean --no-acl --no-owner -h hostname -U username -d database_name latest.dump
Pro tip: Most platforms offer migration assistance or one-click imports from Heroku backups.
Phase 5: DNS and Domain Setup
- Update DNS records to point to your new platform
- Set up SSL certificates (usually automatic)
- Test thoroughly before switching traffic
- Use a subdomain first for testing (staging.yourapp.com)
Phase 6: Go Live
- Schedule maintenance window if needed
- Update DNS to production
- Monitor closely for the first 24 hours
- Keep Heroku running briefly as backup
Migration Gotchas to Watch Out For
Environment Differences
- File system: Most alternatives use ephemeral file systems like Heroku
- Process types: Worker processes might need different configuration
- Logging: Log aggregation works differently across platforms
Performance Considerations
- Cold starts: Some platforms have different cold start behaviors
- Memory limits: Resource allocations vary between providers
- Scaling: Auto-scaling configurations differ
Common Issues
# Build failures due to missing dependencies
npm install --production=false
# Database connection issues
# Check SSL requirements and connection pooling
# Asset serving problems
# Verify static file configuration
Cost Comparison: Real Numbers
Here's what you might save:
Heroku (old pricing):
- Basic web dyno: $25/month
- Hobby Postgres: $9/month
- Total: $34/month
Railway:
- Starter plan: $5/month (includes database)
- Total: $5/month
Savings: $348/year per app
For developers with multiple projects, the savings add up fast.
When to Consider Managed Migration
If you're dealing with:
- Complex multi-service architectures
- Critical production applications
- Limited DevOps experience
- Time constraints
A managed migration service can handle the entire process, including:
- Platform evaluation and recommendation
- Complete migration execution
- DNS and SSL setup
- Post-migration optimization
- Ongoing support
Final Thoughts
Migrating from Heroku doesn't have to be scary. Modern alternatives offer similar developer experiences at fraction of the cost. The key is planning properly and testing thoroughly.
Whether you DIY the migration or use a managed service, the important thing is getting off Heroku's expensive pricing before it kills your project's profitability.
Start with a non-critical app to test the waters, then move your production workloads once you're comfortable with the process. Your wallet will thank you.
Alex Hackney
DeployMyVibe