Neo4j Connection String Generator
Generate connection strings for Neo4j in any format. Node.js, Python, Java, Go, .NET, and more.
Client-side only — nothing leaves your browser
neo4j://localhost:7687
What is a Neo4j Connection String?
A Neo4j connection string (URI) contains the information needed to connect to a Neo4j database: the protocol scheme, host address, and port. Unlike relational databases, Neo4j specifies the target database and credentials through driver configuration rather than in the URI itself. All official Neo4j drivers across languages accept the same URI format.
Connection Schemes
- neo4j:// — Routing-enabled connection for clusters (recommended)
- bolt:// — Direct connection to a single instance
- +s — TLS encryption with certificate verification
- +ssc — TLS encryption with self-signed certificate support
Quick Reference
| Format | Example Pattern |
|---|---|
| Neo4j URI (routing) | neo4j://host:7687 |
| Bolt URI (direct) | bolt://host:7687 |
| With TLS (Aura) | neo4j+s://xxxx.databases.neo4j.io:7687 |
| Node.js | neo4j.driver("neo4j://host:7687", neo4j.auth.basic("user", "pass")) |
| Python | GraphDatabase.driver("neo4j://host:7687", auth=("user", "pass")) |
| Java | GraphDatabase.driver("neo4j://host:7687", AuthTokens.basic("user", "pass")) |
| .NET | GraphDatabase.Driver("neo4j://host:7687", AuthTokens.Basic("user", "pass")) |
| Go | neo4j.NewDriverWithContext("neo4j://host:7687", neo4j.BasicAuth("user", "pass", "")) |
Frequently Asked Questions
What is the Neo4j Bolt protocol?
Bolt is Neo4j's proprietary binary protocol designed for efficient communication between client drivers and the Neo4j database. It operates on port 7687 by default and is used by all official Neo4j drivers. Bolt is more performant than HTTP for database operations because it uses a compact binary format, supports connection pooling, and maintains stateful sessions. All modern Neo4j connection strings use either bolt:// or neo4j:// URI schemes, both of which communicate over the Bolt protocol.
What is the difference between neo4j:// and bolt:// connection schemes?
The bolt:// scheme creates a direct connection to a single Neo4j instance, while neo4j:// enables routing-aware connections for Neo4j clusters (Aura, causal clusters). With neo4j://, the driver automatically discovers cluster topology and routes read queries to followers and write queries to the leader. Use bolt:// for single-instance deployments or when you need to target a specific server. Use neo4j:// for production clusters and Neo4j Aura. Both schemes support TLS variants: +s for verified TLS and +ssc for self-signed certificates.
How do I connect to Neo4j from Python?
Install the official driver with 'pip install neo4j', then use: from neo4j import GraphDatabase; driver = GraphDatabase.driver("neo4j://localhost:7687", auth=("neo4j", "password")). Use driver.verify_connectivity() to test the connection. For Neo4j Aura, use the neo4j+s:// scheme with your Aura credentials. Always close the driver when done with driver.close(), or use a context manager: 'with GraphDatabase.driver(...) as driver'. Specify a database with driver.session(database="mydb").
How do I connect to Neo4j in Docker?
From the host machine, use neo4j://localhost:7687 if you mapped the Bolt port with -p 7687:7687. From another container in the same Docker network, use the container name as the host: neo4j://neo4j-container:7687. In Docker Compose, use the service name (e.g., neo4j://neo4j:7687). Set the initial password with the NEO4J_AUTH environment variable (e.g., NEO4J_AUTH=neo4j/your_password). Make sure to also map port 7474 if you need the browser UI.
Why does Neo4j show 'connection refused' or 'ServiceUnavailable'?
The most common causes are: (1) Neo4j is not running -- check with 'neo4j status' or verify the Docker container is up. (2) Wrong port -- Bolt uses 7687, not 7474 (which is HTTP/browser). (3) Firewall or network rules blocking port 7687. (4) Using bolt:// against a cluster that requires neo4j:// for routing. (5) TLS mismatch -- using bolt:// when the server requires bolt+s://, or vice versa. (6) The database has not finished starting -- Neo4j can take a few seconds to become available after launch. Check neo4j.conf for the bolt connector settings.
Need a Neo4j GUI Client?
1bench is a modern database client for Neo4j and 20+ other databases. Query, browse, and manage your data visually.
Learn More