---
title: "Deploy OpenStock"
description: "Open-source stock tracker: charts, news and watchlists, with MongoDB"
category: "Other"
url: https://railway.com/deploy/openstock-2
---

# Deploy OpenStock

Open-source stock tracker: charts, news and watchlists, with MongoDB

**[Deploy OpenStock on Railway](https://railway.com/template/openstock-2)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/openstock-2/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### OpenStock https://raw.githubusercontent.com/aalfath/openstock-railway-template/main/assets/openstock.png

- **Source:** https://github.com/aalfath/openstock-railway-template
- **Health check:** /api/auth/ok
- **Public domain:** Yes

### MongoDB https://devicons.railway.app/i/mongodb.svg

- **Image:** mongo:7.0.48@sha256:41e8195b2791692695e1dc9bd21cd51d0a3af05fff8ace9304a5c1acf94f1ae1
- **Start command:** `docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0 --wiredTigerCacheSizeGB 0.25 --setParameter diagnosticDataCollectionEnabled=false`

## Documentation

# Deploy and Host OpenStock on Railway

OpenStock is a free, open-source (AGPL-3.0) stock market app by Open Dev Society. It shows a market overview, stock pages with TradingView charts, company profiles and news, searches listed companies across exchanges with ⌘K, and keeps a personal watchlist for each user. Market data comes from Finnhub with your own API key.

## About Hosting OpenStock

This template runs two services. OpenStock (the Next.js app, official release image pinned by digest) is built from a public GitHub wrapper repo and served on a Railway domain with a health check. MongoDB 7 keeps users, sessions and watchlists on a Railway volume and is reached only over the private network with a generated password. The session-signing secret is generated too, so the only thing you enter is a free Finnhub API key. After deploy, open the URL and sign up: there is no default admin. Both services fit in 0.5 GB of RAM each, so the template also runs on the Free and Trial plans.

## Common Use Cases

* A private stock dashboard and watchlist for yourself, without ads or a third-party account
* A shared market tracker for a small team, club or classroom, each member with their own watchlist
* A self-hosted base for experimenting with OpenStock's code, data sources and features

## Dependencies for OpenStock Hosting

* A Finnhub API key (free tier at finnhub.io) for search, quotes, profiles and news
* MongoDB 7 (included in this template, on its own volume)

### Deployment Dependencies

* OpenStock source and releases: https://github.com/Open-Dev-Society/OpenStock (release v2026.11.22)
* Upstream configuration reference: https://github.com/Open-Dev-Society/OpenStock/blob/v2026.11.22/.env.example
* Template wrapper repo (Dockerfile, start script, changelog): https://github.com/aalfath/openstock-railway-template
* Finnhub API keys: https://finnhub.io/register

### Implementation Details

Services in this template:

* **OpenStock**: the web app on port 3000, public HTTPS domain, health check `/api/auth/ok`. Its start script sizes Node's heap to the memory limit and exits non-zero on a crash, so Railway restarts it.
* **MongoDB**: `mongo:7.0.48` with a 0.25 GB WiredTiger cache, data on a volume at `/data/db`, no public TCP proxy.

Variables you can add later on the OpenStock service: `NODEMAILER_EMAIL` and `NODEMAILER_PASSWORD` (welcome and password-reset emails; without them, emails are skipped), `INNGEST_SIGNING_KEY` and `INNGEST_EVENT_KEY` (weekly digest jobs, with an Inngest app pointing at `https://YOUR-DOMAIN/api/inngest`), `GEMINI_API_KEY` (AI-written email text), `GOOGLE_CLIENT_ID`/`GITHUB_CLIENT_ID` and their secrets (social sign-in). Sign-up is open to anyone with the URL, so keep it private if the instance is only for you. Quotes refresh hourly (upstream's default data mode).

Updates: the app builds from the GitHub wrapper repo, so Railway shows an "update available" notice when a new OpenStock release is merged there. Read the repo's CHANGELOG first. Your data stays on the MongoDB volume.

## Why Deploy OpenStock on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying OpenStock on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/openstock-2
