Self-host
Self-hosted stock tracker
OpenStock is a Next.js app with MongoDB, built to run on a small VPS. The hosted site is the convenient version. The same code is what you run if you want the data and the alerts under your own keys.
What you run
Docker Compose starts the app and MongoDB together. MongoDB stays on the Docker network and is not published on the host. A prebuilt image is published to ghcr.io/open-dev-society/openstock for amd64 and arm64 on every push to main. Railway, Vercel and a couple of one-click hosts are documented in the README.
You need Node 22 if you build from source, a MongoDB database, and a Finnhub API key, the same one the README asks for. Charts still load from TradingView in the browser, so they stay live without that key. Quotes, search and email alerts use the key. Finnhub’s own terms are personal use; these public pages do not display those quotes.
How fresh the numbers are
Two modes. Cached is the default: quotes refresh about once an hour and are shared by everyone using that instance. Realtime refreshes about every 15 seconds and turns on price alerts, which are checked every five minutes and emailed when a target is crossed. Realtime is a build-time setting (NEXT_PUBLIC_OPENSTOCK_DATA_MODE=realtime) plus your own key. The prebuilt image ships in cached mode; build it yourself for realtime.
Background jobs (welcome email, alerts, the Monday digest) need Inngest. Email needs a mailbox. The digest also needs an AI provider key. Leave those unset and the app still shows charts and a watchlist.
Who it is for
Someone who wants a watchlist on a machine they control, or a team sharing one instance. It is a single web app, not a multi-tenant host. The licence is AGPL-3.0: running a modified copy as a service means offering the source to its users.
Questions
Does self-hosting include the charts?
Yes. Charts are TradingView widgets loaded in the browser. They do not go through your API key.
Will alerts work on the default Docker image?
The prebuilt image is cached mode, which does not send price alerts. Set realtime mode and rebuild, and configure email plus Inngest, and alerts email you when a price crosses the target.
Where is the install guide?
The README section “Self-hosting” covers Docker Compose, the container image, Railway and Vercel, including the environment variables.
Look up a company
Other guides
Use OpenStock free
Charts, a watchlist and the US filing pages are free. OpenStock is not a broker and this is not investment advice.
