bolt://localhost:7687: Neo4j's Driver Connection

bolt://localhost:7687 is where a local Neo4j database accepts Bolt connections, the binary protocol its drivers and Cypher Shell use. It is not a web page, so pasting it into a browser shows nothing useful. Open Neo4j Browser on port 7474 instead, and give drivers the bolt or neo4j URI with your credentials.

Neo4j's default ports
PortProtocolUsed by
7687BoltDrivers, Cypher Shell, Neo4j Browser queries
7474HTTPNeo4j Browser web page
7473HTTPSNeo4j Browser when TLS is on

Updated

Neo4j splits its traffic: the Browser page loads over HTTP on 7474, and then the page itself opens a Bolt connection to 7687 to run queries. Both ports must be reachable, which is why a Docker container that publishes only 7474 shows the login page but never connects.

Run Neo4j and connect to Bolt

Start Neo4j in Docker with both ports published

Replace the password; it must be at least eight characters on Neo4j 5.

docker run -d --name neo4j \
  -p 7474:7474 -p 7687:7687 \
  -e NEO4J_AUTH=neo4j/change-me-please \
  neo4j:5

Connect from Node.js

verifyConnectivity fails fast with a clear error if 7687 is unreachable.

import neo4j from "neo4j-driver";

const driver = neo4j.driver(
  "neo4j://localhost:7687",
  neo4j.auth.basic("neo4j", "change-me-please"),
);
await driver.verifyConnectivity();

Docker and remote connections

Publish both ports with -p 7474:7474 -p 7687:7687. When Neo4j runs on another machine, its Bolt connector must listen on all interfaces, set with server.default_listen_address=0.0.0.0, and the Browser's connect URL must name that machine instead of localhost.

Graph databases fit apps with deep relationships; a brochure site for a clinic or studio does not need one, and We.Inc stores that kind of site's content without any database setup on your side.

How it works

  1. Start the database from Neo4j Desktop, the service, or a container.
  2. Open http://localhost:7474 and enter bolt://localhost:7687 as the connect URL.
  3. Sign in as neo4j with the password you set on first start.
  4. Use the same URI and credentials in your driver code.

Tips

  • Drivers accept neo4j:// as well as bolt://. The neo4j scheme enables routing for clusters and works against a single server too.
  • A ServiceUnavailable error from a driver nearly always means nothing listens on 7687 or a firewall blocks it.
  • In Docker Compose, other services reach the database by its service name, for example bolt://neo4j:7687, not localhost.

Frequently asked questions

Why does bolt://localhost:7687 not open in my browser?

Bolt is not HTTP, so a browser cannot display it. Go to http://localhost:7474 for Neo4j Browser; it uses 7687 behind the scenes once you connect.

What is the default Neo4j username and password?

The user is neo4j and the initial password is neo4j, which you must change on first login. In Docker you can set it up front with NEO4J_AUTH=neo4j/yourpassword.

How do I fix ServiceUnavailable: Could not connect to localhost:7687?

Check that the database is started and that port 7687 is published if it runs in a container. With encryption mismatches, match the scheme to the server: bolt+s or neo4j+s only when TLS is configured.

Can I change the Bolt port?

Yes. Set server.bolt.listen_address=:7688 in neo4j.conf on Neo4j 5, then use bolt://localhost:7688 in clients. Older 4.x releases use dbms.connector.bolt.listen_address.

Related: localhost:27017 (MongoDB), localhost refused to connect, Docker Compose env files, What is localhost.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap