---
title: "Deploy openstock"
description: "OpenStock is an open-source stock monitor platform built with Next.js"
category: "Analytics"
url: https://railway.com/deploy/openstock
---

# Deploy openstock

OpenStock is an open-source stock monitor platform built with Next.js

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

- **Creator:** Ken Komatsu's Projects
- **Category:** Analytics
- **Total deploys:** 1

## Template content

### openstock

- **Image:** xiaosong233/openstock:railway-latest
- **Public domain:** Yes

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

- **Image:** mongo:8.0
- **Start command:** `docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0 --setParameter diagnosticDataCollectionEnabled=false`

## Documentation

# Deploy and Host OpenStock on Railway

## About Hosting

[OpenStock](https://github.com/Open-Dev-Society/OpenStock) is an open-source stock market web app built with Next.js 15, Better Auth, and MongoDB. It provides watchlists, stock search, news, and chart widgets, plus optional automated email flows through Inngest.

On Railway, the recommended architecture is two services:

- **OpenStock app service** (Next.js runtime)
- **MongoDB service** (managed Mongo database)

## Why Deploy

- **Own your data** — host your auth, watchlists, and user preferences privately.
- **Full-stack in one project** — app + database managed together in Railway.
- **Open-source flexibility** — customize workflows and integrations.
- **Fast setup** — Railway handles build and runtime for Next.js quickly.

## Common Use Cases

- Personal or team stock tracking dashboard with custom watchlists.
- Internal finance/market-monitoring portal for startups and communities.
- Educational/demo deployment for Next.js + Better Auth + MongoDB architecture.
- Base project for building custom alerting or AI-assisted market summaries.

## Dependencies for Deployment

### Deployment Dependencies

| Dependency | Details |
|---|---|
| **Docker Image** | `docker.io/xiaosong233/openstock:railway-latest` (replace with your own tag) |
| **Build Mode** | Local Docker build + Docker Hub push |
| **Container Port** | `3000` |
| **Database** | Railway MongoDB service |
| **Required App Env Vars** | `NODE_ENV`, `MONGODB_URI`, `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL`, `NEXT_PUBLIC_FINNHUB_API_KEY`, `FINNHUB_BASE_URL`, `GEMINI_API_KEY`, `INNGEST_SIGNING_KEY`, `NODEMAILER_EMAIL`, `NODEMAILER_PASSWORD` |
| **Optional App Env Vars** | `AI_PROVIDER`, `MINIMAX_API_KEY`, `KIT_API_KEY`, `KIT_API_SECRET`, `KIT_WELCOME_FORM_ID` |
| **Persistent Volume** | Managed by Railway MongoDB service |
| **Start Command Override** | Not required (use project default `npm start`) |



## Similar templates

- [Betterlytics](https://railway.com/deploy/betterlytics) — Betterlytics is a cookieless analytics platform GDPR-compliant.
- [Finance Tracker](https://railway.com/deploy/finance-tracker-1) — Private multi-user household finance ledger with budgets and CSV import.
- [Matomo Analytics + MariaDB](https://railway.com/deploy/matomo-analytics-mariadb) — Privacy-friendly analytics with MariaDB and persistent volumes.

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