Railway

Deploy Neo4j | Open Source Graph Database with Cypher

Graph database with Cypher, APOC plugins and external Bolt access

Deploy Neo4j | Open Source Graph Database with Cypher

Just deployed

/data

Deploy and Host Neo4j on Railway

Neo4j is the world's most widely adopted graph database, storing data as nodes and relationships so connected queries stay fast no matter how deep they go.

About Hosting Neo4j

This template runs the official neo4j:5.26.29-community image — the current LTS release — with no custom build in between, so you get upstream Neo4j and upstream security updates. The APOC procedure library is installed on boot, the database lives on a persistent Railway volume mounted at /data, and the JVM heap and page cache are pinned so the container behaves predictably inside its memory limit instead of guessing from the cgroup.

Both ways in are wired up: Neo4j Browser is served over your public Railway domain on port 7474, and the Bolt protocol is exposed through a Railway TCP proxy on 7687. The advertised addresses are set to those endpoints, so Browser connects to your actual database and any Bolt driver — Python, JavaScript, Go, Java — connects from outside the project without extra configuration. A random password is generated at deploy time; nothing ships with a default credential.

Common Use Cases

  • Knowledge graphs for AI and RAG: Model entities and their relationships, then traverse them to give an LLM grounded, connected context instead of isolated chunks.
  • Recommendations and social graphs: Answer "who and what is related to this, and how closely" in a single Cypher query rather than a pile of joins.
  • Fraud detection and network analysis: Follow chains of shared attributes across many hops to surface rings and paths that stay invisible in tabular data.

Dependencies for Neo4j Hosting

Deployment Dependencies

  • Neo4j Community Edition 5.26 LTS — the database itself
  • APOC — the standard procedure and function library, installed on first boot
  • A Railway volume for /data, and a TCP proxy for Bolt on port 7687

Implementation Details

The service listens on :: because Railway's private network is IPv6-only — binding IPv4 alone leaves the container unreachable to both its neighbours and the edge proxy.

Two settings make external access work, and they are the usual reason self-hosted Neo4j feels broken:

server.bolt.advertised_address = :
server.http.advertised_address = :443

Neo4j Browser reads the advertised Bolt address and dials it from your machine. Without it the Browser falls back to localhost:7687 and refuses to connect, even though the database is healthy.

Memory is fixed rather than inferred:

server.memory.heap.initial_size = 512m
server.memory.heap.max_size     = 512m
server.memory.pagecache.size    = 512m

Left unset, the JVM claims a quarter of the container limit and gets OOM-killed under load.

Credentials come from NEO4J_AUTH, generated per deployment as neo4j/. The password is baked into the database when the volume initialises, so change it with ALTER CURRENT USER SET PASSWORD rather than by editing the variable.

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.

Resources: about 2 GB RAM for the defaults above (512 MB heap + 512 MB page cache + JVM overhead), and a 1 GB volume that you can grow later without downtime. Raise the heap and page cache together if your working set outgrows it.


Template Content

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
7
View Template
Redis
Self Host Latest Redis with Railway

Arloodots
2
View Template
Postgres Backup to Cloudflare R2 (S3-Compatible)
Automated PostgreSQL backups to S3-compatible storage with encryption

Artour
7