
Deploy OpenHands + DeepSeek AI Coding Agent
AI coding agent with DeepSeek, GitHub integration, and persistent workspace
deepseek-api
Just deployed
openhands-deepseek
Just deployed
OpenHands + DeepSeek AI Coding Agent
A production-ready deployment of OpenHands on Railway, configured to use DeepSeek as your LLM provider. This brings autonomous AI engineering to your own infrastructure.
Deploy and Host
Depoy OpenHands with DeepSeek on Railway in minutes. Get a persistent workspace, GitHub integration, basic auth protection, and a public web URL. All conversations and code changes survive redeploys.
About Hosting
OpenHands runs in local-runtime mode on Railway—the agent executes in the container itself (fast, fine for single-user or trusted use). Your workspace is stored on a persistent 5GB volume. Railway provides automatic HTTPS, HTTP basic auth, and environment-variable-based configuration.
Why Deploy
- Self-hosted: Your code and conversations stay private on your Railway instance
- DeepSeek-powered: Uses the affordable deepseek-chat model for code generation
- GitHub-native: Clone repos, create branches, write fixes, and open pull requests autonomously
- Cost-effective: ~$5–15/month for compute + pay-as-you-go for DeepSeek API tokens
- Always-on: Agents continue working even when your laptop is shut down
Common Use Cases
- Autonomous issue resolution: Assign a GitHub issue, get a pull request
- Full-stack feature development: Describe a feature, get scaffolded and tested code
- Codebase refactoring: Automate legacy migrations, TypeScript conversions, dependency bumps
- Code review assistance: Multi-conversation workspace for reviewing and iterating
- Persistent workflows: Long-running tasks that outlive a session
Dependencies for
You'll need:
- DeepSeek API key: Sign up at platform.deepseek.com
- GitHub personal access token: Create at github.com/settings/tokens with
reposcope - Basic auth credentials: Choose a username and password to protect your instance
Features
- Web UI: Access OpenHands from any browser via a public Railway URL
- DeepSeek Integration: Uses deepseek-chat model for code generation and analysis
- GitHub Integration: Connect your repos, read code, create branches, and open pull requests
- Persistent Workspace: All conversations, files, and history survive redeploys
- Basic Auth: Simple username/password protection for your deployment
- Local Runtime: Executes in the Railway container (fast, fine for single-user/trusted use)
Getting Started
- Click "Deploy" and wait for the build (~3–5 minutes)
- Once healthy, open the public Railway URL
- Log in with your basic auth username and password
- In Settings, add your DeepSeek API key and GitHub token
- Start a conversation, attach repositories, and assign tasks
Configuration
| Variable | Description | Example |
|---|---|---|
LLM_MODEL | DeepSeek model (pre-filled) | deepseek-chat |
LLM_API_KEY | DeepSeek API key | Your API key from platform.deepseek.com |
LLM_BASE_URL | DeepSeek API endpoint (pre-filled) | https://api.deepseek.com/v1 |
GITHUB_TOKEN | GitHub personal access token with repo scope | Your token from github.com/settings/tokens |
BASIC_AUTH_USER | Web UI login username | admin |
BASIC_AUTH_PASSWORD | Web UI login password | Your secure password |
RUNTIME | Agent runtime mode (pre-filled for Railway) | local |
Agent Capabilities
- Read/write files in your workspace
- Run shell commands (within the container)
- Git operations: clone, branch, commit, push
- Create pull requests via GitHub API
- Web browsing for research and context
- Multi-conversation workspace with persistent chat history
Cost
- Railway: ~$5–15/month on the Hobby plan for compute
- DeepSeek API: Pay per token used (very affordable)
- No per-seat licensing — one deployment, unlimited conversations
Security & Privacy
- Your code stays in your Railway instance (private)
- API keys stored as encrypted Railway secrets
- Basic auth protects HTTP and WebSocket endpoints
- Agent sandbox is isolated to the mounted
/workspacevolume - Local-runtime mode: Agent executes in the container; keep the deployment access-controlled since it has shell access
Troubleshooting
Deployment won't start
- Check the deployment logs for errors
- Ensure
LLM_API_KEYandGITHUB_TOKENare set in Variables - Verify the image tag is valid (defaults to
latest)
Web UI won't load
- Confirm basic auth username and password
- Check browser console for errors
- Wait for deployment to become healthy (initial builds take 3–5 minutes)
Agent can't access repos
- Verify your GitHub token has
reposcope - Check that the token is still valid (not expired)
- Confirm the repo URL is correct and public or accessible to your token
Upgrading
Bump the Docker image tag in Railway service settings and redeploy. Your workspace and conversation history survive on the persistent volume.
Resources
Template Content
deepseek-api
ghcr.io/railwayapp/function-bun:1.4.0openhands-deepseek
ghcr.io/openhands/agent-canvas:latest