Adding the Debian repository
The Neo4j Debian repository can be used on Debian and Debian-based distributions like Ubuntu.
Documentation for the Neo4j Debian package is available here.
To set up a repository that will always have the latest calendar versioned Neo4j, run:
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
To avoid the risk of the apt package manager accidentally forcing a database upgrade, different major and minor releases of Neo4j are available separately inside the repository.
When adding the Neo4j repository to apt, you must specify the major version (and minor version if using 4.x Neo4j and earlier) you wish to use.
Here are some examples:
Just give me the latest Neo4j versions
This is a good place to start if you are unsure:
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
Neo4j version 5.x
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable 5' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
Neo4j version 4.4
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable 4.4' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
Neo4j version 3.5
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable 3.5' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
Neo4j versions before 3.4
Versions of Neo4j before 3.4 are all grouped together under thelegacy label:
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable legacy' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
Installing Neo4j
To install Neo4j Community Edition:
sudo apt-get install neo4j
To install Neo4j Enterprise Edition:
sudo apt-get install neo4j-enterprise
Installing other versions
By default you will install the latest Neo4j version. The repository also contains older versions. You can list the available versions with this command:
apt list -a neo4j
To install a specific version:
Neo4j Debian package naming and versions follow Debian policy on versioning, so there is a preceding epoch
1:before the version.
sudo apt-get install neo4j=1:5.10.0
sudo apt-get install neo4j=1:4.4.20
A similar command can be used for Enterprise Edition.
sudo apt-get install neo4j-enterprise=1:5.10.0
sudo apt-get install neo4j-enterprise=1:4.4.20