Railway Deployment Guide
This guide walks you through creating a Railway template for one-click Seer deployment. Railway templates are created through their UI, not declarative config files.
Overview
The Seer Railway deployment consists of 4 services:
- PostgreSQL - Database (Railway-managed)
- Redis - Task queue and cache (Railway-managed)
- seer-api - FastAPI backend server (custom)
- seer-worker - Background task worker (custom)
Step 1: Initial Manual Deployment
1.1 Create New Railway Project
- Go to Railway
- Sign in to your account
- Click "New Project"
- Select "Empty Project"
- Name it "seer-template" (you can change this later)
1.2 Add PostgreSQL Service
- Click "+ New" in your project
- Select "Database" → "PostgreSQL"
- Railway will automatically provision the database
- Note:
DATABASE_URLis automatically created as a reference variable
1.3 Add Redis Service
- Click "+ New" in your project
- Select "Database" → "Redis"
- Railway will automatically provision Redis
- Note:
REDIS_URLis automatically created as a reference variable
1.4 Add API Service
-
Click "+ New" in your project
-
Select "GitHub Repo"
-
Connect your Seer repository
-
Service Settings:
- Name:
seer-api - Root Directory:
/(leave blank) - Build Command: (leave default, uses Dockerfile)
- Start Command: (managed by railway.toml)
- Name:
-
Environment Variables: Click "Variables" tab and add:
DATABASE_URL=${{Postgres.DATABASE_URL}}
REDIS_URL=${{Redis.REDIS_URL}}
PORT=8000
AUTO_APPLY_DATABASE_MIGRATIONS=true
OPENAI_API_KEY=[your-key-for-testing] -
Service Configuration:
- Go to "Settings" tab
- Under "Railway Config File Path", enter:
railway.toml - Enable "Public Networking"
- Click "Generate Domain" to create a public URL
-
Deploy:
- Click "Deploy" or wait for automatic deployment
- Monitor build logs to ensure success
1.5 Add Worker Service
-
Click "+ New" in your project
-
Select "GitHub Repo"
-
Select the same Seer repository
-
Service Settings:
- Name:
seer-worker - Root Directory:
/(leave blank) - Build Command: (leave default, uses Dockerfile)
- Start Command: (managed by railway.worker.toml)
- Name:
-
Environment Variables: Click "Variables" tab and add:
DATABASE_URL=${{Postgres.DATABASE_URL}}
REDIS_URL=${{Redis.REDIS_URL}}
AUTO_APPLY_DATABASE_MIGRATIONS=false
OPENAI_API_KEY=${{seer-api.OPENAI_API_KEY}}Note: Worker references API's OPENAI_API_KEY to avoid duplication
-
Service Configuration:
- Go to "Settings" tab
- Under "Railway Config File Path", enter:
railway.worker.toml - Do NOT enable "Public Networking" (worker is private)
-
Deploy:
- Click "Deploy" or wait for automatic deployment
- Monitor build logs to ensure success
Step 2: Test the Deployment
2.1 Verify Services Are Running
Check that all 4 services show "Active" status:
- ✅ Postgres (green)
- ✅ Redis (green)
- ✅ seer-api (green)
- ✅ seer-worker (green)
2.2 Test the API
- Click on the
seer-apiservice - Copy the generated public URL (e.g.,
https://seer-production-xxxx.up.railway.app) - Test the health endpoint:
Expected response:
curl https://your-railway-url.up.railway.app/health{"status":"ok"}or similar
2.3 Verify Database Migrations
- Click on
seer-apiservice - Check the deployment logs
- Look for "Running database migrations..." message
- Ensure migrations completed without errors
2.4 Test Workflow Creation
- Visit your Railway URL in a browser
- Try creating a simple workflow
- Verify the workflow executes successfully
Step 3: Convert to Template
3.1 Create Template
- In your Railway project, click the project name dropdown (top left)
- Select "Project Settings"
- Scroll to "Template" section
- Click "Create Template from Project"
3.2 Configure Template Metadata
Template Name:
Seer - AI Workflow Builder
Template Description:
Deploy Seer, an AI-powered workflow automation platform with visual builder,
integrated tools (Google Workspace, GitHub, Supabase), and fine-grained control.
Includes:
- FastAPI backend with workflow execution engine
- Background task worker for triggers and polling
- PostgreSQL database for persistence
- Redis for task queuing
Perfect for self-hosting workflow automation with enterprise-grade features.
Template README:
# Seer Deployment
This template deploys a complete Seer instance with all required services.
## What's Included
- **API Server**: FastAPI backend with workflow builder
- **Worker**: Background task processor for triggers and workflow execution
- **PostgreSQL**: Workflow and user data storage
- **Redis**: Task queue and caching
## Required Configuration
You'll need to provide an OpenAI API key during deployment:
- `OPENAI_API_KEY`: Get from [OpenAI Platform](https://platform.openai.com/api-keys)
## Post-Deployment Setup
1. Access your Seer instance at the generated Railway URL
2. Add optional integrations in Settings → Variables:
- `TAVILY_API_KEY` - Web search capabilities
- `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET` - Google Workspace
- `GITHUB_CLIENT_ID` / `GITHUB_CLIENT_SECRET` - GitHub integration
- `ANTHROPIC_API_KEY` - Alternative LLM provider
## Estimated Cost
- Free tier: $5/month credit (good for testing)
- Production: $15-30/month
- Includes PostgreSQL backups, SSL certificates, DDoS protection
## Documentation
- [Seer GitHub](https://github.com/your-org/seer)
- [Documentation](https://docs.your-domain.com)
- [Support](https://github.com/your-org/seer/issues)
3.3 Configure Template Variables
Define which environment variables users must provide:
Required Variables:
| Variable | Description | Default Value |
|---|---|---|
OPENAI_API_KEY | OpenAI API key for workflow execution and AI assistance | (none - user must provide) |
Note: All other variables (DATABASE_URL, REDIS_URL, etc.) are automatically configured via service references.
3.4 Set Template Icon and Tags
- Icon: Upload Seer logo or choose from Railway's icon library
- Tags: Add relevant tags:
automationaiworkflowpythonfastapi
3.5 Publish Template
- Review all template settings
- Click "Publish Template"
- Copy the template URL (format:
https://railway.app/template/[template-id])
Step 4: Update Seer Repository
4.1 Add Deploy Button to README
Edit the main README.md file and add:
### Deploy to Railway
Deploy Seer to Railway with one click:
[](https://railway.app/template/[YOUR-TEMPLATE-ID])
Replace [YOUR-TEMPLATE-ID] with the actual template ID from Step 3.5.
4.2 Update Documentation
Add a "Deployment" section to your docs with:
- Link to this Railway deployment guide
- Cost estimates
- Configuration instructions
- Troubleshooting tips
Step 5: Test Template Deployment
5.1 Test from Another Account
- Log out of Railway (or use incognito mode)
- Sign in with a different Railway account
- Click the "Deploy on Railway" button
- Verify:
- All 4 services are created
- Environment variable prompt appears for OPENAI_API_KEY
- Deployment completes successfully
- Public URL is accessible
- Health check passes
5.2 Troubleshooting Common Issues
Build fails:
- Check Dockerfile syntax
- Verify all dependencies in pyproject.toml
- Review build logs for specific errors
Database connection fails:
- Ensure DATABASE_URL reference is correct:
${{Postgres.DATABASE_URL}} - Check that Postgres service is healthy before API starts
- Verify migrations ran successfully
Worker not starting:
- Check railway.worker.toml configuration
- Verify REDIS_URL is correctly referenced
- Review worker logs for errors
Health check fails:
- Confirm /health endpoint exists in api/main.py
- Check PORT environment variable is set correctly
- Verify uvicorn is binding to 0.0.0.0, not 127.0.0.1
Maintenance
Updating the Template
When you update the Seer codebase:
- Push changes to the repository
- Railway will auto-deploy to your template project
- Test the changes in your template project
- If everything works, the template automatically uses the latest code
- Users deploying from the template will get the latest version
Template Versioning
Railway templates always deploy from the latest commit on the default branch. To maintain stability:
- Use a
mainorproductionbranch for stable releases - Test new features in separate branches
- Only merge to main when ready for production
Support
If you encounter issues:
- Check Railway's documentation
- Review Seer's GitHub issues
- Contact Railway support through their Discord or help portal
- Open an issue in the Seer repository with the
deploymentlabel
Cost Optimization Tips
- Start small: Use Railway's free tier ($5/month credit) for testing
- Scale gradually: Upgrade services only when needed
- Monitor usage: Check Railway's usage dashboard regularly
- Optimize resources:
- Use smaller PostgreSQL instance for development
- Reduce worker replicas if not needed
- Enable hibernation for non-production instances
Security Best Practices
- Rotate API keys regularly in Railway's environment variables
- Use Railway's secret management (variables are encrypted at rest)
- Enable 2FA on your Railway account
- Limit public access: Only seer-api should have public networking enabled
- Monitor logs: Regularly review deployment and application logs for anomalies
- Keep dependencies updated: Regularly update Python packages and base images