As a developer, you may wish to download Neo4j and run it locally on your desktop computer. We recommend this as an easy way to discover Neo4j.
As a systems administrator, you may wish to install Neo4j using a packaging system so you can ensure that a cluster of machines have identical installs. See the section called “Linux Packages” for more information on this.
For information on High Availability, please refer to Chapter 23, High Availability.
With the exception of our Windows Installer, you’ll need a Java Virtual Machine installed on your computer. We recommend that you install the Java JDK 7 from the Oracle Website.
Download the version that you want from http://neo4j.com/download.
Note | |
---|---|
The installer will prompt to be granted Administrator privileges. Newer versions of Windows come with a SmartScreen feature that may prevent the installer from running — you can make it run anyway by clicking "More info" on the "Windows protected your PC" screen. |
Download the latest release from http://neo4j.com/download.
Right-click the downloaded file, click Extract All.
NEO4J_HOME
Download the latest release from http://neo4j.com/download.
Right-click the downloaded file, click Extract All.
NEO4J_HOME
With administrative rights, Neo4j can be installed as a Windows service.
%NEO4J_HOME%
bin\Neo4jInstaller.bat install
To uninstall, run bin\Neo4jInstaller.bat remove
as Administrator.
To query the status of the service, run: bin\Neo4jInstaller.bat status
To start the service from the command prompt, run: sc start Neo4j-Server
To stop the service from the command prompt, run: sc stop Neo4j-Server
You can also start and stop Neo4j from the Windows Service Manager.
Note | |
---|---|
Some users have reported problems on Windows when using the ZoneAlarm firewall. If you are having problems getting large responses from the server, or if the web interface does not work, try disabling ZoneAlarm. Contact ZoneAlarm support to get information on how to resolve this. |
For Debian packages, see the instructions at http://debian.neo4j.org.
Download the latest release from http://neo4j.com/download.
Extract the contents of the archive, using: tar -cf <filename>
NEO4J_HOME
Change directory to: $NEO4J_HOME
./bin/neo4j console
Neo4j can participate in the normal system startup and shutdown process. The following procedure should work on most popular Linux distributions:
cd $NEO4J_HOME
sudo ./bin/neo4j-installer install
If asked, enter your password to gain super-user privileges.
sudo service neo4j-service status
This should indicate that the server is not running.
sudo service neo4j-service start
This will start the server.
sudo service neo4j-service stop
This will stop the server.
During installation you will be given the option to select the user Neo4j will run as.
You will be asked to supply a username (defaulting to neo4j
) and if that user is not present on the system it will be created as a system account and the $NEO4J_HOME/data directory will be chown
'ed to that user.
You are encouraged to create a dedicated user for running the service and for that reason it is suggested that you unpack the distribution package under /opt or your site specific optional packages directory.
After installation you may have to do some platform specific configuration and performance tuning. For that, refer to Section 22.12, “Linux Performance Guide”.
To remove the server from the set of startup services, the proper commands are:
cd $NEO4J_HOME
sudo ./bin/neo4j-installer remove
This will stop the server, if running, and remove it.
Note that if you chose to create a new user account, on uninstall you will be prompted to remove it from the system.
Note | |
---|---|
This approach to running Neo4j as a server is deprecated. We strongly advise you to run Neo4j from a package where feasible. |
You can alternatively build your own init.d script. See for instance the Linux Standard Base specification on system initialization, or one of the many samples and tutorials.
Using Homebrew (see http://brew.sh/), to install the latest stable version of Neo4j Server, issue the following command:
brew install neo4j && neo4j start
This will get a Neo4j instance running on http://localhost:7474.
The installation files will reside in ls /usr/local/Cellar/neo4j/community-{NEO4J_VERSION}/libexec/
— to tweak settings and symlink the database directory if desired.
After the installation, Neo4j can run either as a service or from a terminal.
The server can be started in the background from the terminal with the command neo4j start
, and then stopped again with neo4j stop
.
The server can also be started in the foreground with neo4j console
— then it’s log output will be printed to the terminal.
The neo4j-shell
command can be used to interact with Neo4j from the command line using Cypher. It will automatically connect to any
server that is running on localhost with the default port, otherwise it will show a help message. You can alternatively start the
shell with an embedded Neo4j instance, by using the -path path/to/data
argument — note that only a single instance of Neo4j
can access the database files at a time.
Neo4j can be installed as a Mac launchd job:
cd $NEO4J_HOME
./bin/neo4j-installer install
launchctl list | grep neo
This should reveal the launchd "org.neo4j.server.7474" job for running the Neo4j Server.
launchctl list | grep neo4j
This should indicate that the server is running.
launchctl stop org.neo4j.server
This should stop the server.
launchctl start org.neo4j.server
This should start the server again.
To remove the launchctl service, issue the following command:
./bin/neo4j-installer remove
Unlike previous versions, OS X Mavericks does not come with Java pre-installed. You might encounter that the first time you run Neo4j, where OS X will trigger a popup offering you to install Java SE 6.
Java SE 6 is incompatible with Neo4j 2.0, so we strongly advise you to skip installing Java SE 6 if you have no other uses for it. Instead, for Neo4j 2.0 we recommend you install Java SE 7 from Oracle (http://www.oracle.com/technetwork/java/javase/downloads/index.html) as that is what we support for production use.
Neo4j can be set up to run as several instances on one machine, providing for instance several databases for development.
For how to set this up, see Section 23.6.3, “Alternative setup: Creating a local cluster for testing”. Just use the Neo4j edition of your choice, follow the guide and remember to not set the servers to run in HA mode.
Copyright © 2014 Neo Technology