Deploy to Railway in 10 Minutes¶
From local development to production in minutes
Ready to launch your Wappa conversational application? Railway makes deployment ridiculously simple. No complex configurations, no DevOps headachesβjust pure focus on building great WhatsApp experiences.
π Why Railway?¶
Railway is the perfect match for Wappa applications:
- Zero-config deployments - Detects your Dockerfile automatically
- Built-in Redis - Add Redis with one click, no setup required
- Automatic scaling - Handles traffic spikes without intervention
- Free tier friendly - Perfect for development and small projects
- Production ready - SSL, CDN, and monitoring included
The result? Your conversational app running on global infrastructure in under 10 minutes.
β Prerequisites¶
Before we start, make sure you have:
- Railway account - Sign up here (free tier available)
- Railway CLI installed - We'll do this in Step 1
- WhatsApp Business API credentials - Access token, phone ID, and business ID
- Your Wappa project working locally - Test it first!
First time with Railway?
No worries! We'll walk through everything step by step.
π Step-by-Step Deployment¶
Step 1: Install Railway CLI¶
Step 2: Login to Railway¶
β Success indicator: You'll see "Logged in as [your-email]"
Step 3: Create Your Railway Project¶
Navigate to your Wappa project directory and initialize:
# In your project directory (e.g., wappa_full_example/)
cd your-wappa-project
# Initialize Railway project
railway init
# Select "Create new project"
# Choose a memorable project name (e.g., "my-whatsapp-app")
β Success indicator: You'll see "Project created: [project-name]"
Step 4: Add Redis Service¶
Your conversational app needs Redis for state management. Railway makes this trivial:
β Success indicator: Redis service appears in your Railway dashboard
Redis URL Magic
Railway automatically creates the REDIS_URL
environment variable as redis://redis.railway.internal:6379
. No manual configuration needed!
Step 5: Deploy Your Application¶
Here's where the magic happens:
Railway will: - π Detect your Dockerfile
- ποΈ Build your container - π Deploy to production infrastructure - π Generate your public URL
β Success indicator: You'll see "Deployment successful" with your app URL
Step 6: Configure Environment Variables¶
Set your WhatsApp credentials in Railway:
# Set WhatsApp Business API credentials
railway variables set WP_ACCESS_TOKEN=your_access_token_here
railway variables set WP_PHONE_ID=your_phone_number_id_here
railway variables set WP_BID=your_business_id_here
railway variables set WHATSAPP_WEBHOOK_VERIFY_TOKEN=your_webhook_token_here
Dashboard Alternative
Prefer a visual interface? Set variables in Railway Dashboard β Your Service β Variables tab.
The Redis URL is automatically configured as:
Step 7: Configure WhatsApp Webhook¶
Now connect WhatsApp to your deployed app:
-
Get your Railway URL from the dashboard or CLI:
-
Configure webhook in Meta for Developers:
- Webhook URL:
https://your-app.up.railway.app/webhook/messenger/YOUR_PHONE_ID/whatsapp
-
Verify Token:
your_webhook_token_here
-
Test your webhook:
β Success indicator: Health check returns 200 OK
π Your Conversational App is Live!¶
Congratulations! Your Wappa application is now running on production infrastructure with:
- β Automatic scaling - Handles traffic spikes
- β SSL certificate - Secure HTTPS by default
- β Redis caching - Fast state management
- β Global CDN - Fast worldwide response
- β Health monitoring - Automatic issue detection
Test Your Deployment¶
Send a test message to your WhatsApp Business number. You should see:
- Echo response - Your message echoed back
- Interactive commands - Try
/button
or/list
- Logs in Railway - Check Railway dashboard β Logs tab
π§ Managing Your Deployment¶
View Real-Time Logs¶
# Follow logs in real-time
railway logs
# Or view in Railway Dashboard β Deployments β View Logs
Update Your App¶
Made changes? Deploy updates instantly:
Add Custom Domain (Optional)¶
# Add your custom domain
railway domain add yourdomain.com
# Or via Railway Dashboard β Settings β Domains
π¨ Troubleshooting¶
Build Failures¶
Problem: Deployment fails during build
# Check build logs
railway logs --deployment
# Common solutions:
# β’ Ensure Dockerfile exists in project root
# β’ Verify uv.lock file is present
# β’ Check Python version compatibility (3.12+)
Environment Variable Issues¶
Problem: App starts but doesn't work
# List current variables
railway variables
# Check for missing required variables:
# WP_ACCESS_TOKEN, WP_PHONE_ID, WP_BID, WHATSAPP_WEBHOOK_VERIFY_TOKEN
Redis Connection Problems¶
Problem: Cache-related errors in logs
# Verify Redis service exists
railway status
# Check Redis URL format
railway variables get REDIS_URL
# Should be: redis://redis.railway.internal:6379
Webhook Not Responding¶
Problem: WhatsApp messages not reaching your app
-
Verify webhook URL format:
-
Test webhook endpoint:
-
Check WhatsApp Business API settings in Meta for Developers
π‘ Pro Tips¶
Development Workflow¶
# Pull production environment for local development
railway run -- uv run python -m app.main
# This runs your local app with production environment variables
Monitoring¶
# Check deployment status
railway status
# View application metrics in Railway Dashboard
# Monitor Redis usage and performance
Scaling¶
Railway automatically scales based on traffic, but you can configure:
- Vertical scaling - More CPU/memory per instance
- Horizontal scaling - More instances (Pro plan required)
- Auto-sleep - Saves costs by sleeping during low traffic
π― What's Next?¶
Your conversational application is now live! Here are some next steps:
- Monitor your app β - Track performance and user engagement
- Configure custom domain β - Use your own domain
- Add CI/CD β - Automatic deployments from GitHub
- Scale your app β - Optimize for higher traffic
π° Railway Pricing¶
Hobby Plan (Free)¶
- $5 credit/month
- Perfect for development and testing
- No credit card required
Pro Plan ($20/month)¶
- Unlimited usage
- Custom domains
- Auto-scaling
- Priority support
You're Live! π
Your Wappa conversational application is now running on production infrastructure. Send a message to your WhatsApp Business number and watch the magic happen!
Built with β€οΈ using the Wappa Framework