Deploy Cobalt | Open-Source Video & Audio Downloader
Self-Host Cobalt on Railway and get a public media download API instantly
Cobalt API
Just deployed
Deploy and Host Cobalt Tools
Self-host Cobalt Tools on Railway and get a private, ad-free media download API running in minutes. Cobalt (ghcr.io/imputnet/cobalt) is an open-source media downloader that works as a proxy — paste a link, get the file, no ads, no trackers, no caching. This template deploys the Cobalt API backend with all required environment variables pre-configured, including your Railway public domain wired to API_URL automatically.
Getting Started with Cobalt Tools on Railway
Once your Railway deployment is live, your Cobalt instance is immediately accessible as a JSON API at your public Railway domain. To test it, send a POST request to https:/// with a media URL and receive a direct download link in response. You can pair this API with any Cobalt-compatible web frontend (such as cobalt-web) or call it directly from scripts and automation tools. For a quick sanity check, hit https:/// in your browser — a running instance returns a JSON response with version info. If you want to restrict access, set AUTH_REQUIRED=1 and configure API keys before going public.
About Hosting Cobalt Tools
Cobalt is a media downloader built around a single principle: no nonsense. It never caches content — everything is proxied in real time from the original source to the end user. It supports downloading from over 20 platforms including YouTube, TikTok, Instagram, Twitter/X, Reddit, SoundCloud, and more.
Key features:
- Proxy-style streaming — content is never stored server-side
- Supports video (up to 8K/HDR on YouTube), audio, images, and GIFs
- No ads, trackers, paywalls, or rate-limit popups
- Optional API key authentication and Cloudflare Turnstile bot protection
- CORS wildcard support for easy frontend integration
- AGPL-3.0 licensed, fully open source
The Railway template deploys the Cobalt API service. The API exposes a single endpoint that accepts a media URL and returns a proxied download stream or redirect.
Why Deploy Cobalt Tools on Railway
One-click deploy with zero Docker or Compose configuration to manage. Railway handles:
- Auto-generated public domain wired to
API_URLout of the box - Managed TLS and HTTPS with no certificate setup
- Instant redeploys from updated Docker image tags
- No reverse proxy (nginx/Caddy) setup required
- Environment variable injection at runtime
Common Use Cases
- Personal media archiving — download publicly accessible videos and audio to your own storage without third-party services
- Privacy-conscious teams — run a private Cobalt instance for internal use, away from rate-limited public instances
- Developer automation — integrate the Cobalt API into scripts, bots, or pipelines that need programmatic media retrieval
- Community instances — host a shared instance for a Discord server or small community as an alternative to the official
cobalt.tools
Dependencies for Cobalt Tools
- Cobalt API —
ghcr.io/imputnet/cobalt(Docker image from GitHub Container Registry)
No database or additional services are required. Cobalt is stateless by design.
Environment Variables Reference
| Variable | Description | Required |
|---|---|---|
API_URL | Public URL of your instance. Pre-set to your Railway domain. Tunnels won't work without this. | ✅ Yes |
API_PORT | Port the API listens on. Defaults to 9000. | No |
CORS_WILDCARD | Set to 1 to allow requests from any origin. Useful when connecting a frontend. | No |
AUTH_REQUIRED | Set to 1 to require API key or Turnstile auth on all requests. | No |
COOKIE_PATH | Path to a cookies.json file for authenticated platform access (e.g. age-gated YouTube). | No |
RATELIMIT_MAX | Max requests per window per IP. | No |
Deployment Dependencies
- Runtime: Node.js >= 18 (handled by the Docker image)
- Docker image:
ghcr.io/imputnet/cobalt(GitHub Container Registry) - Source repo: github.com/imputnet/cobalt
- Docs: run-an-instance.md
Minimum Hardware Requirements for Cobalt Tools
Cobalt is lightweight — it doesn't transcode or store media, it proxies it. Resource usage scales with concurrent download traffic.
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 0.5 vCPU | 1 vCPU |
| RAM | 256 MB | 512 MB |
| Storage | 100 MB (image only) | 100 MB |
| Node.js | >= 18 | >= 20 |
On Railway's Hobby plan, the default 512 MB RAM / shared CPU is sufficient for personal or low-traffic use.
Self-Hosting Cobalt Tools
Docker (recommended):
# docker-compose.yml
services:
cobalt:
image: ghcr.io/imputnet/cobalt:11
init: true
read_only: true
restart: unless-stopped
ports:
- 9000:9000/tcp
environment:
API_URL: "https://your-domain.example.com/"
CORS_WILDCARD: "1"
Start it with docker compose up -d. The API is then available at http://localhost:9000.
Manual (Node.js):
git clone https://github.com/imputnet/cobalt
cd cobalt/api
pnpm install
echo 'API_URL="http://localhost:9000/"' > .env
pnpm start
Requires Node.js >= 18 and pnpm. On Ubuntu, also install nscd for DNS resolution inside ffmpeg-static.
Is Cobalt Tools Free?
Cobalt is fully open source under the AGPL-3.0 license — free to use, self-host, and modify. There is no paid tier or cloud-hosted SaaS version. When you deploy on Railway, you pay only for the underlying infrastructure (typically under $5/month on the Hobby plan for personal use). The official public instance at cobalt.tools is free to use without an account.
Cobalt vs Alternatives
| Feature | Cobalt | yt-dlp | JDownloader |
|---|---|---|---|
| Open source | ✅ | ✅ | Partial |
| Self-hostable | ✅ | N/A (CLI) | ✅ |
| Web UI / API | ✅ API | ❌ CLI only | ✅ GUI |
| No caching/storage | ✅ | N/A | ❌ |
| 20+ platform support | ✅ | ✅ (1000+) | ✅ |
| Docker deploy | ✅ | N/A | ✅ |
| Auth / rate limiting | ✅ | N/A | ❌ |
yt-dlp has broader platform coverage and is the go-to for power users and scripts. Cobalt is the better choice when you need a web-accessible API or a clean self-hosted instance without CLI management.
FAQ
What is Cobalt Tools? Cobalt is an open-source media downloader and proxy API. You paste a public media link, it returns the file. No ads, no sign-up, no caching. It supports YouTube, TikTok, Instagram, Twitter/X, Reddit, SoundCloud, and 15+ other platforms.
What does this Railway template deploy?
It deploys the Cobalt API backend (ghcr.io/imputnet/cobalt) as a single Railway service. The API_URL is automatically set to your Railway-generated public domain, and CORS_WILDCARD is enabled so you can connect any frontend immediately.
How do I use Cobalt after deploying on Railway?
Send a POST request to https:/// with a JSON body like {"url": "https://www.youtube.com/watch?v=..."}. You'll get back a JSON response with a url field pointing to the proxied download stream. You can also connect a Cobalt web frontend by pointing it at your Railway API URL. Tools like cobalt.tools let you use any compatible API instance via Settings → Instance.
Does Cobalt support YouTube downloads?
Cobalt supports YouTube but public instances (including the official cobalt.tools) can face rate limits from YouTube's network restrictions. A private self-hosted instance on Railway typically has better reliability since it uses a unique IP. For best results, optionally configure a cookies.json with a logged-in YouTube session.
Is Cobalt a piracy tool? No. Cobalt only downloads free and publicly accessible content — the same content available through browser developer tools. It takes zero liability and is explicitly not intended for piracy. Users are responsible for the content they download and how they use it.
Can I add a web UI to my Railway Cobalt instance?
The Docker image (ghcr.io/imputnet/cobalt) runs the API only. To add a web frontend, you can deploy a second Railway service using a community Cobalt web frontend image (e.g. from NotNite/cobalt-web-docker) and point its API_URL at your Railway API service's internal domain.
How do I protect my public Cobalt instance from abuse?
Set AUTH_REQUIRED=1 and configure API keys via a keys.json file, or enable Cloudflare Turnstile by setting TURNSTILE_SECRET and TURNSTILE_SITEKEY. Full details in the protect-an-instance docs.
Template Content
Cobalt API
ghcr.io/imputnet/cobalt