---
title: "Deploy Neo4j | (Just Updated) Graph Database, Password Generated, Persistent"
description: "Neo4j graph DB with generated password, Query API and volume"
category: "Storage"
url: https://railway.com/deploy/neo4j-or-just-updated-graph-database-pas
---

# Deploy Neo4j | (Just Updated) Graph Database, Password Generated, Persistent

Neo4j graph DB with generated password, Query API and volume

**[Deploy Neo4j | (Just Updated) Graph Database, Password Generated, Persistent on Railway](https://railway.com/template/neo4j-or-just-updated-graph-database-pas)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/neo4j-or-just-updated-graph-database-pas/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### neo4j

- **Image:** neo4j@sha256:0a6e7aedf54a531f76286032d4365ead65b11cca05e4a15cdf23b8e53d6db02b
- **Start command:** `/bin/sh -c 'export NEO4J_AUTH="neo4j/$GRAPH_PASSWORD" NEO4J_ACCEPT_LICENSE_AGREEMENT=no NEO4J_server_http_listen__address="0.0.0.0:$PORT" NEO4J_server_bolt_listen__address=0.0.0.0:7687 NEO4J_server_memory_heap_initial__size=512m NEO4J_server_memory_heap_max__size=1g NEO4J_server_memory_pagecache_size=512m JAVA_TOOL_OPTIONS=-XX:ActiveProcessorCount=2; echo "neo4j uid=$(id -u) data_owner=$(stat -c %u:%g /data) pids.max=$(cat /sys/fs/cgroup/pids.max 2>/dev/null)"; exec /startup/docker-entrypoint.sh neo4j'`
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host Neo4j on Railway

Neo4j is the most widely used open-source graph database. It stores data as nodes and relationships and is queried with Cypher. This template runs Neo4j Community with a persistent volume, a generated password, and a public HTTPS endpoint for the Query API.

## About Hosting Neo4j

This template runs the official `neo4j` image (pinned by digest). Data lives on a volume mounted at `/data`, so graphs survive redeploys. Authentication is enabled at boot: the username is `neo4j` and the password is the `GRAPH_PASSWORD` variable, generated for you at deploy time. The HTTP port is bound to Railway's `$PORT`; Bolt listens on 7687 inside the project network and is published to your other services as `GRAPH_BOLT_URL`. The JVM is capped to the container (heap and page cache sized explicitly, `ActiveProcessorCount=2`) so it does not read the host's resources.

Agent contract:

- Base URL: `https://`
- Username: `neo4j`
- Password variable: `GRAPH_PASSWORD`
- Bolt URL variable (private network): `GRAPH_BOLT_URL`
- Health path: `/`
- Query endpoint: `POST /db/neo4j/query/v2` (HTTP basic auth)

```bash
curl -s -u neo4j:$GRAPH_PASSWORD -X POST https:///db/neo4j/query/v2 \
  -H 'content-type: application/json' \
  -d '{"statement":"CREATE (n:Note {text:\"hello\"}) RETURN n.text AS text"}'
```

## Why Deploy Neo4j 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 Neo4j 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.

- **Secure by default** — the password is generated per deploy and unauthenticated requests get 401.
- **Data survives redeploys** — the volume is preconfigured and verified with a write, redeploy, read.
- **Zero configuration** — no variables to fill in; the contract above is everything a client needs.
- **Standard drivers work** — official Neo4j drivers connect over Bolt, and any HTTP client can use the Query API.

## Common Use Cases

- **Knowledge graphs and agent memory** — store entities and relationships for AI agents and RAG pipelines.
- **Recommendations and fraud detection** — traverse connected data that is awkward in relational tables.
- **Network and dependency mapping** — model infrastructure, org charts, and supply chains.

## Dependencies for Neo4j Hosting

- A volume mounted at `/data` (included in this template).

### Deployment Dependencies

- [neo4j/neo4j](https://github.com/neo4j/neo4j) — upstream server
- [neo4j on Docker Hub](https://hub.docker.com/_/neo4j) — the pinned image this template deploys


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/neo4j-or-just-updated-graph-database-pas
