Windows installation
Before you install Neo4j on Windows, check System Requirements to see if your setup is suitable.
Windows console application
-
If it is not already installed, get OpenJDK 17 or Oracle Java 17. From version 5.14 onwards, Neo4j also supports JDK 21.
-
Download the latest release from Neo4j Deployment Center.
Select the appropriate ZIP distribution.
-
Check that the SHA hash of the downloaded file is correct:
-
To find the correct SHA hash, go to Neo4j Deployment Center and click
SHA-256
, which is located below your downloaded file. -
Using the appropriate commands for your platform, display the
SHA-256
hash for the file that you downloaded. -
Ensure that the two are identical.
-
-
Right-click the downloaded file and click Extract All.
-
Place the extracted files in a permanent home on your server and set the environment variable
NEO4J_HOME
to point to the extracted directory, for example,export NEO4J_HOME=/path/to/_<NEO4J_HOME>
to make it easier to refer to it later. -
From Neo4j 5.4 onwards, you are required to accept either the commercial or the evaluation license agreement before running the Neo4j Enterprise Edition. If you are using Community Edition, you can skip this step.
-
Use one of the following options to accept the commercial license agreement. See the Neo4j licensing page for details on the available agreements.
-
Set it as an environment variable using
set NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
. -
Run
$NEO4J_HOME\bin\neo4j-admin server license --accept-commercial
-
-
Use one of the following options to accept the Neo4j Evaluation Agreement for Neo4j Software.
-
Set it as an environment variable using
set NEO4J_ACCEPT_LICENSE_AGREEMENT=eval
. -
Run
$NEO4J_HOME\bin\neo4j-admin server license --accept-evaluation
.
-
-
-
(Optional) Decouple the data and configuration directories from the binary files by setting the environment variable
NEO4J_CONF
andserver.directories.data
to point to the desired locations. Storing your data and configuration on a separate disk or partition can simplify the upgrade process later. -
Before starting up the database for the first time, it is recommended to use the
set-initial-password
command ofneo4j-admin
to define the password for the native userneo4j
.If the password is not set explicitly using this method, it will be set to the default password
neo4j
. In that case, you will be prompted to change the default password at first login.
For more information, see Set an initial password. -
Start Neo4j:
-
To run Neo4j as a console application, use:
$NEO4J_HOME\bin\neo4j console
. -
To install Neo4j as a service use:
$NEO4J_HOME\bin\neo4j windows-service install
. For additional commands and to learn about the Windows PowerShell module included in the Zip file, see Windows PowerShell module.
-
-
Open http://localhost:7474 in your web browser.
-
Connect using the username
neo4j
with your password or the default passwordneo4j
. You will then be prompted to change the password. -
Stop the server by typing
Ctrl-C
in the console.
Windows service
Neo4j can also be run as a Windows service.
By default, the Neo4j Windows service runs as the LocalSystem account, which has full access to the system. This is a security risk, and it is recommended to run the service as a user without full LocalSystem privileges. |
Install the Windows service
Install the service with bin\neo4j windows-service install
, and start it with bin\neo4j start
.
The available commands for bin\neo4j
are: version
, help
, console
, start
, stop
, restart
, status
, and windows-service
.
When installing a new release of Neo4j, you must first run |
Change the Windows service configuration
When Neo4j is installed as a service, the Java options are stored in the service configuration file.
If you want to change any of these options or environment variables after the service is installed, you must update and restart the service for the changes to take effect.
For example, updating the value of server.memory.heap.initial_size
in the default neo4j.conf file or by using the NEO4J_CONF
environment variable will not automatically apply the changes.
The service needs to be updated and restarted to pick them up.
To update the service, run bin\neo4j windows-service update
.
Then restart the service to run it with the new configuration.
The same applies to the path to where Java is installed on the system.
If the path changes, for example when upgrading to a new version of Java, it is necessary to run the update-service
command and restart the service.
Then, the new Java location will be used by the service.
-
Install service
bin\neo4j windows-service install
-
Change memory configuration
echo server.memory.heap.initial_size=8g >> conf\neo4j.conf echo server.memory.heap.initial_size=16g >> conf\neo4j.conf
-
Update service
bin\neo4j windows-service update
-
Restart service
bin\neo4j restart
Windows PowerShell module
The Neo4j PowerShell module allows administrators to:
-
Install, start, and stop Neo4j Windows® Services.
-
Start tools, such as
Neo4j Admin
andCypher Shell
.
The PowerShell module is installed as part of the ZIP file distributions of Neo4j.
System requirements
-
Requires PowerShell v2.0 or above.
-
Supported on either 32 or 64-bit operating systems.
Manage Neo4j on Windows
On Windows, it is sometimes necessary to Unblock a downloaded ZIP file before you can import its contents as a module.
-
Right-click on the ZIP file and choose Properties.
A dialog appears with an Unblock button. -
Click the Unblock button to enable the import of the module.
Running scripts has to be enabled on the system. This can, for example, be achieved by executing the following from an elevated PowerShell prompt:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
For more information, see About execution policies.
The PowerShell module displays a warning if it detects that you do not have administrative rights.
Import the module file
The module file is located in the bin directory of your Neo4j installation.
-
Assuming that Neo4j is installed in C:\Neo4j, run the following command to import the module:
Import-Module C:\Neo4j\bin\Neo4j-Management.psd1
This adds the module to the current session.
-
Once the module is imported, you can start an interactive console version of a Neo4j Server:
Invoke-Neo4j console
To stop the server, use Ctrl-C
in the console window, created by the command.
Inspect the module
You can get all available commands in the module by running the following command:
Get-Command -Module Neo4j-Management
The output should be similar to the following:
CommandType Name Version Source
----------- ---- ------- ------
Function Invoke-Neo4j 5.25.1 Neo4j-Management
Function Invoke-Neo4jAdmin 5.25.1 Neo4j-Management
Function Invoke-Neo4jBackup 5.25.1 Neo4j-Management
Function Invoke-Neo4jImport 5.25.1 Neo4j-Management
Function Invoke-Neo4jShell 5.25.1 Neo4j-Management
The module also supports the standard PowerShell help commands
Get-Help Invoke-Neo4j
Run the following to see examples of help commands:
Get-Help Invoke-Neo4j -examples
Uninstall Neo4j
Here are the steps to uninstall Neo4j on Windows:
-
(Optional) Create a backup to avoid losing your data.
-
Stop all Neo4j processes by using the Task Manager.
-
Uninstall the Neo4j Windows service:
--- bin\neo4j windows-service uninstall ---
-
Delete NEO4J_HOME:
--- rmdir NEO4J_HOME ---