Skip to content

Commit 13fd5a3

Browse files
renetapopovamauvoNataliaIvakina
committed
Improve Windows installation (#2639)
Co-authored-by: David Pond <[email protected]> Co-authored-by: Natalia Ivakina <[email protected]>
1 parent c3e8a22 commit 13fd5a3

File tree

2 files changed

+122
-126
lines changed

2 files changed

+122
-126
lines changed

modules/ROOT/pages/installation/osx.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ If it is not already installed, get link:https://openjdk.org/[OpenJDK 21] or lin
1010

1111
You can install Neo4j on macOS either by downloading and extracting a TAR archive or by using the Homebrew package manager.
1212

13-
=== Install Neo4j using a tar archive
13+
=== Install Neo4j using a TAR archive
1414

15-
. Download the Linux/Mac Executable {neo4j-version-exact} (TAR) release from link:{neo4j-download-center-uri}[Neo4j Deployment Center].
15+
. Download the Linux / Mac Executable {neo4j-version-exact} (tar) release from link:{neo4j-download-center-uri}[Neo4j Deployment Center].
1616
. Extract the contents of the archive, using `tar -xf <filename>` or by double-clicking the file.
1717
. 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.
1818
. (Recommended) xref:configuration/file-locations.adoc#file-locations-file-locations[Change the default locations] of the _data_, _conf_, _certificates_, _licenses_, and _plugins_ (if you plan to use custom plugins) directories by setting the environment variable `NEO4J_CONF` and the respective xref:configuration/configuration-settings.adoc#_server_directories_settings[`server.directories.*`] settings to point to the desired locations.

modules/ROOT/pages/installation/windows.adoc

Lines changed: 120 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -3,96 +3,90 @@
33
= Windows installation
44

55
Before you install Neo4j on Windows, check xref:installation/requirements.adoc[System Requirements] to see if your setup is suitable.
6-
6+
If it is not already installed, get link:https://www.oracle.com/java/technologies/downloads/?er=221886[OracleJDK 21] or link:https://www.azul.com/downloads/[ZuluJDK 21].
77

88
[[windows-console]]
9-
== Windows console application
9+
== Install and start Neo4j
1010

11-
. If it is not already installed, get link:https://openjdk.org/[OpenJDK 21] or link:https://www.oracle.com/java/technologies/downloads/?er=221886[Oracle Java 21].
12-
. Download the latest release from link:{neo4j-download-center-uri}[Neo4j Deployment Center].
13-
+
14-
Select the appropriate ZIP distribution.
15-
. Check that the SHA hash of the downloaded file is correct:
16-
.. To find the correct SHA hash, go to Neo4j Deployment Center and click `SHA-256`, which is located below your downloaded file.
17-
.. Using the appropriate commands for your platform, display the `SHA-256` hash for the file that you downloaded.
18-
.. Ensure that the two are identical.
19-
. Right-click the downloaded file and click *Extract All*.
20-
. 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.
21-
. xref:configuration/file-locations.adoc#file-locations-file-locations[Change the default locations] of the _data_, _conf_, _certificates_, _licenses_, and _plugins_ (if you plan to use custom plugins) directories by setting the environment variable `NEO4J_CONF` and the respective xref:configuration/configuration-settings.adoc#_server_directories_settings[`server.directories.*`] settings to point to the desired locations.
11+
You can install Neo4j on Windows either by downloading and extracting a ZIP archive, by running it as a Windows service, or by using the Windows PowerShell module.
12+
13+
=== Install Neo4j using a zip archive
14+
15+
. Download the Windows Executable {neo4j-version-exact} (zip) release from link:{neo4j-download-center-uri}[Neo4j Deployment Center].
16+
. Right-click the downloaded file and select *Extract All* to extract the contents of the archive.
17+
. 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, `setx NEO4J_HOME "C:\neo4j\neo4j-<NEO4J_VERSION>"` to make it easier to refer to it later.
18+
. (Recommended) xref:configuration/file-locations.adoc#file-locations-file-locations[Change the default locations] of the _data_, _conf_, _certificates_, _licenses_, and _plugins_ (if you plan to use custom plugins) directories by setting the environment variable `NEO4J_CONF` and the respective xref:configuration/configuration-settings.adoc#_server_directories_settings[`server.directories.*`] settings to point to the desired locations.
2219
+
2320
[NOTE]
2421
====
2522
Storing your Neo4j files outside `NEO4J_HOME` will simplify the upgrade process later because you will be able to replace the DBMS binaries without affecting the configuration and state.
2623
Otherwise, these Neo4j files will remain in the old installation folder and may be accidentally overwritten during an upgrade or deleted during a subsequent uninstall.
2724
====
28-
. Accept either the commercial or the evaluation license agreement before running the Neo4j Enterprise Edition.
25+
. label:enterprise[Enterprise Edition] Accept either the commercial or the evaluation license agreement.
2926
If you are using Community Edition, you can skip this step.
3027
* Use one of the following options to accept the commercial license agreement.
3128
See the link:https://legal.neo4j.com/[Neo4j licensing] page for details on the available agreements.
32-
+
33-
** Set it as an environment variable using `set NEO4J_ACCEPT_LICENSE_AGREEMENT=yes`.
34-
** Run `$NEO4J_HOME\bin\neo4j-admin server license --accept-commercial`
35-
* Use one of the following options to accept the link:https://neo4j.com/terms/enterprise_us/[Neo4j Evaluation Agreement for Neo4j Software].
36-
+
37-
** Set it as an environment variable using `set NEO4J_ACCEPT_LICENSE_AGREEMENT=eval`.
38-
** Run `$NEO4J_HOME\bin\neo4j-admin server license --accept-evaluation`.
29+
** Set the environment variable `NEO4J_ACCEPT_LICENSE_AGREEMENT=yes`.
30+
** Run `%NEO4J_HOME%\bin\neo4j-admin server license --accept-commercial`
31+
* Use one of the following options to accept the link:https://neo4j.com/terms/enterprise_us/[Neo4j Evaluation Agreement for Neo4j Software]:
32+
** Set the environment variable `NEO4J_ACCEPT_LICENSE_AGREEMENT=eval`.
33+
** Run `%NEO4J_HOME%\bin\neo4j-admin server license --accept-evaluation`.
3934
. Before starting up the database for the first time, it is recommended to use the `set-initial-password` command of `neo4j-admin` to define the password for the native user `neo4j`.
4035
+
4136
If the password is not set explicitly using this method, it will be set to the default password `neo4j`.
4237
In that case, you will be prompted to change the default password at first login. +
4338
For more information, see xref:configuration/set-initial-password.adoc[].
44-
. Start Neo4j:
45-
* To run Neo4j as a console application, use: `$NEO4J_HOME\bin\neo4j console`.
46-
* To install Neo4j as a service use: `$NEO4J_HOME\bin\neo4j windows-service install`.
47-
For additional commands and to learn about the Windows PowerShell module included in the Zip file, see xref:installation/windows.adoc#powershell[Windows PowerShell module].
48-
. Open _\http://localhost:7474/_ in your web browser.
49-
. Connect using the username `neo4j` with your password or the default password `neo4j`.
50-
You will then be prompted to change the password.
51-
. Stop the server by typing `Ctrl-C` in the console.
39+
. Start Neo4j as a console application by running `%NEO4J_HOME%\bin\neo4j console` in your command prompt.
5240

5341

5442
[[windows-service]]
55-
== Windows service
43+
=== Install Neo4j as a Windows service
5644

57-
Neo4j can also be run as a Windows service.
45+
You can install Neo4j as a Windows service.
5846

5947
[WARNING]
6048
====
6149
By default, the Neo4j Windows service runs as the LocalSystem account, which has full access to the system.
6250
This is a security risk, and it is recommended to run the service as a user without full LocalSystem privileges.
6351
====
6452

65-
=== Install the Windows service
66-
67-
Install the service with `bin\neo4j windows-service install`, and start it with `bin\neo4j start`.
68-
69-
The available commands for `bin\neo4j` are: `version`, `help`, `console`, `start`, `stop`, `restart`, `status`, and `windows-service`.
53+
. Create a user account that the Neo4j service will run as using using services.msc, or the sc (Service Control) command.
54+
You can use an existing user account, but it must have the `Log on as a service` right.
55+
. Follow the steps in the <<_install_neo4j_using_a_zip_archive, Install Neo4j using a zip archive>> section to download and extract the ZIP archive and set up the environment variables.
56+
. Run the following command in your command prompt to install the service:
57+
+
58+
[source, bash]
59+
----
60+
%NEO4J_HOME%\bin\neo4j windows-service install
61+
----
62+
. Start the Neo4j service by running `%NEO4J_HOME%\bin\neo4j start`.
7063

7164
[NOTE]
7265
====
73-
When installing a new release of Neo4j, you must first run `bin\neo4j windows-service uninstall` on any previously installed versions.
66+
When installing a new release of Neo4j, you must first run `%NEO4J_HOME%\bin\neo4j windows-service uninstall` on any previously installed versions.
67+
Then, install the new version using the `install` command as described above.
7468
====
7569

7670
[[windows-update-service]]
77-
=== Change the Windows service configuration
71+
=== Change the Neo4j Windows service configuration
7872

7973
When Neo4j is installed as a service, the Java options are stored in the service configuration file.
8074
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.
8175
For example, updating the value of `server.memory.heap.initial_size` in the default xref:configuration/file-locations.adoc[_neo4j.conf_] file or by using the `NEO4J_CONF` environment variable will not automatically apply the changes.
8276
The service needs to be updated and restarted to pick them up.
83-
To update the service, run `bin\neo4j windows-service update`.
77+
To update the service, run `%NEO4J_HOME%\bin\neo4j windows-service update`.
8478
Then restart the service to run it with the new configuration.
8579

8680
The same applies to the path to where Java is installed on the system.
87-
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.
81+
If the path changes, for example when upgrading to a new version of Java, it is necessary to run the `%NEO4J_HOME%\bin\neo4j windows-service update` command and restart the service.
8882
Then, the new Java location will be used by the service.
8983

9084
.Update service example
9185
====
9286
. Install service
9387
+
9488
----
95-
bin\neo4j windows-service install
89+
%NEO4J_HOME%\bin\neo4j windows-service install
9690
----
9791
9892
. Change memory configuration
@@ -105,66 +99,55 @@ echo server.memory.heap.initial_size=16g >> conf\neo4j.conf
10599
. Update service
106100
+
107101
----
108-
bin\neo4j windows-service update
102+
%NEO4J_HOME%\bin\neo4j windows-service update
109103
----
110104
111105
. Restart service
112106
+
113107
----
114-
bin\neo4j restart
108+
%NEO4J_HOME%\bin\neo4j restart
115109
----
116110
====
117111

118112
[[powershell]]
119-
== Windows PowerShell module
120-
121-
The Neo4j PowerShell module allows administrators to:
122-
123-
* Install, start, and stop Neo4j Windows® Services.
124-
* Start tools, such as `Neo4j Admin` and `Cypher Shell`.
113+
=== Install Neo4j using PowerShell
125114

115+
The Neo4j PowerShell module allows administrators to install, start, and stop Neo4j Windows® Services, as well as perform various administrative tasks using `Neo4j Admin` and `Cypher Shell`.
126116
The PowerShell module is installed as part of the https://neo4j.com/deployment-center/[ZIP file] distributions of Neo4j.
117+
It requires PowerShell 5.1 or later (PowerShell 7.x recommended) and is supported on 64-bit Windows operating systems.
127118

128-
129-
[[powershell-requirements]]
130-
=== System requirements
131-
132-
* Requires PowerShell v2.0 or above.
133-
* Supported on either 32 or 64-bit operating systems.
134-
135-
136-
[[powershell-windows]]
137-
=== Manage Neo4j on Windows
138-
139-
On Windows, it is sometimes necessary to _Unblock_ a downloaded ZIP file before you can import its contents as a module.
140-
141-
. Right-click on the ZIP file and choose *Properties*. +
119+
. Unblock the downloaded Neo4j ZIP file if necessary to be able to import the module:
120+
.. Right-click on the ZIP file and choose *Properties*. +
142121
A dialog appears with an *Unblock* button.
143-
. Click the *Unblock* button to enable the import of the module.
144-
+
145-
Running scripts has to be enabled on the system.
146-
This can, for example, be achieved by executing the following from an elevated PowerShell prompt:
122+
.. Click the *Unblock* button to enable the import of the module.
123+
.. Click *Apply* and then *OK* to close the dialog.
124+
. Right-click the downloaded file and select *Extract All* to extract the contents of the archive.
125+
. Run the following command from an elevated PowerShell prompt to enable script execution:
147126
+
148127
[source,powershell]
149128
----
150129
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
151130
----
152131
+
153132
For more information, see https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.5[About execution policies].
154-
133+
+
134+
[NOTE]
135+
====
155136
The PowerShell module displays a warning if it detects that you do not have administrative rights.
137+
====
156138

157-
158-
[[powershell-module-import]]
159-
=== Import the module file
160-
161-
The module file is located in the _bin_ directory of your Neo4j installation.
162-
163-
. Assuming that Neo4j is installed in _C:\Neo4j_, run the following command to import the module:
139+
. Set the environment variable `NEO4J_HOME` to point to the directory where you have installed Neo4j.
140+
For example, you can run the following command in your PowerShell session, assuming you have installed Neo4j in `C:\Neo4j`:
141+
+
142+
[source,powershell]
143+
----
144+
$env:NEO4J_HOME = "C:\Neo4j"
145+
----
146+
. Import the Neo4j PowerShell module by running the following command:
164147
+
165148
[source,powershell]
166149
----
167-
Import-Module C:\Neo4j\bin\Neo4j-Management.psd1
150+
Import-Module $env:NEO4J_HOME\bin\Neo4j-Management.psd1
168151
----
169152
+
170153
This adds the module to the current session.
@@ -176,83 +159,96 @@ This adds the module to the current session.
176159
Invoke-Neo4j console
177160
----
178161

162+
[TIP]
163+
====
179164
To stop the server, use `Ctrl-C` in the console window, created by the command.
165+
====
180166

181167

182168
[[powershell-help]]
183-
=== Inspect the module
184-
185-
You can get all available commands in the module by running the following command:
169+
==== Inspect the module
186170

171+
. Get all available commands in the module by running the following command:
172+
+
187173
[source,powershell]
188174
----
189175
Get-Command -Module Neo4j-Management
190176
----
191-
177+
+
192178
The output should be similar to the following:
193-
179+
+
194180
[source, shell, subs="attributes"]
195181
----
196-
CommandType Name Version Source
197-
----------- ---- ------- ------
198-
Function Invoke-Neo4j {neo4j-version-exact} Neo4j-Management
199-
Function Invoke-Neo4jAdmin {neo4j-version-exact} Neo4j-Management
200-
Function Invoke-Neo4jBackup {neo4j-version-exact} Neo4j-Management
201-
Function Invoke-Neo4jImport {neo4j-version-exact} Neo4j-Management
202-
Function Invoke-Neo4jShell {neo4j-version-exact} Neo4j-Management
182+
CommandType Name Version Source
183+
----------- ---- ------- ------
184+
Function Get-Args 3.0.0 Neo4j-Management
185+
Function Invoke-Neo4j 3.0.0 Neo4j-Management
186+
Function Invoke-Neo4jAdmin 3.0.0 Neo4j-Management
203187
----
204188

205-
The module also supports the standard PowerShell help commands
206-
189+
. See what each command does by running the following command, replacing `<command-name>` with the name of the command you want to inspect, for example, `Invoke-Neo4j`:
190+
+
207191
[source,powershell]
208192
----
209-
Get-Help Invoke-Neo4j
193+
Get-Help <command-name>
210194
----
211195

212-
Run the following to see examples of help commands:
213-
196+
. Run the following to see some usage examples of that command:
197+
+
214198
[source,powershell]
215199
----
216-
Get-Help Invoke-Neo4j -examples
200+
Get-Help <command-name> -examples
217201
----
202+
+
203+
.Usage examples
204+
[options="header", cols="3m,1a"]
205+
|====
206+
| Command
207+
| Description
218208

209+
| Invoke-Neo4j
210+
| Outputs the available commands.
219211

220-
[[powershell-examples]]
221-
=== Example usage
212+
| Invoke-Neo4j status
213+
| Current status of the Neo4j service.
222214

223-
* List of available commands:
224-
+
225-
[source,powershell]
226-
----
227-
Invoke-Neo4j
228-
----
215+
| Invoke-Neo4j windows-service
216+
| Install the service.
229217

230-
* Current status of the Neo4j service:
231-
+
232-
[source,powershell]
233-
----
234-
Invoke-Neo4j status
235-
----
218+
| Invoke-Neo4jAdmin
219+
| Available commands for administrative tasks.
220+
|====
236221

237-
* Install the service with verbose output:
238-
+
239-
[source,powershell]
240-
----
241-
Invoke-Neo4j windows-service -Verbose
242-
----
222+
[TIP]
223+
====
224+
The module commands support the common PowerShell parameter of `Verbose`.
225+
You can add `-Verbose` to any command to get more detailed output.
226+
====
243227

244-
* Available commands for administrative tasks:
245-
+
246-
[source,powershell]
247-
----
248-
Invoke-Neo4jAdmin
249-
----
228+
== Access Neo4j
229+
230+
By default, Neo4j Community Edition does not include graph tools such as visualization, data exploration, and monitoring.
231+
However, you can use the Neo4j Aura console to access these features for free.
232+
No subscription is required.
250233

234+
. Sign up or log in to the link:https://console-preview.neo4j.io/self-managed[Aura Console].
235+
. On the *Instances* page, click the *Self-managed* tab and then *+ Add deployment* button.
236+
. Select *URL Connection*.
237+
. Provide a *Name* and *Connection URL*.
238+
If you have installed Neo4j locally on your system, you can connect to _\http://localhost:7474_.
239+
. Click the *Connect* dropdown to launch various graph tools such as *Query*, *Explore*, and *Dashboards*.
240+
. Type the username `neo4j` and your password or the default password `neo4j`.
241+
You will be prompted to change the latter upon first login.
242+
+
243+
image::aura-add-deployment.png[width=800,alt=Aura add self-managed deployment]
251244

252-
[[powershell-common-parameters]]
253-
=== Common PowerShell parameters
245+
You are now connected and can use the Aura Console to run Cypher queries, visualize graphs, and optionally monitor your local Neo4j database in Neo4j Aura.
246+
For details, see link:https://neo4j.com/docs/getting-started/#_work_with_data[Get started with Neo4j].
254247

255-
The module commands support the common PowerShell parameter of `Verbose`.
248+
Alternatively, you can use the Neo4j Browser, a web-based user interface for interacting with Neo4j that is included with the Neo4j installation.
249+
To access the Neo4j Browser, open a web browser and navigate to _\http://localhost:7474_.
250+
Connect using the username `neo4j` with your password or the default password `neo4j`.
251+
If the default password is used, you will be prompted to change it upon first login.
256252

257253
== Uninstall Neo4j
258254

@@ -264,7 +260,7 @@ Here are the steps to uninstall Neo4j on Windows:
264260
+
265261
[source, shell]
266262
---
267-
bin\neo4j windows-service uninstall
263+
%NEO4J_HOME%\bin\neo4j windows-service uninstall
268264
---
269265
. Delete _NEO4J_HOME_:
270266
+

0 commit comments

Comments
 (0)