How to Install OrientDB Community Edition on AlmaLinux 9 or Rocky Linux 9
Install OrientDB 3.2 Community Edition on AlmaLinux 9 or Rocky Linux 9, run it as a systemd service, reach Studio safely and create a first database.
This guide installs OrientDB Community Edition 3.2, the multi-model (document and graph) database, on AlmaLinux 9 or Rocky Linux 9. At the end the server runs under its own system account as a systemd service, the Studio web interface answers on port 2480, and you have created a first database from the console. CentOS Stream 9 works the same way.
CentOS 7 reached end of life on 30 June 2024 and receives no more security updates, so the RHEL 9 family is the place to run this today. OrientDB is still maintained under the Apache 2 licence: the 3.2 series receives regular patch releases, published on GitHub and Maven Central. The project also publishes an official Docker image, covered at the end.
Requirements
- AlmaLinux 9 or Rocky Linux 9 with a
sudouser. - At least 4 GB of RAM. The start script gives the Java virtual machine a 2 GB heap by default (
-Xms2G -Xmx2G); Step 4 shows how to lower it on a smaller server. - A Java runtime. OrientDB 3.2 is built for Java 8 and newer; this guide uses the OpenJDK 17 package from the distribution.
Step 1: Install Java
sudo dnf -y update
sudo dnf -y install java-17-openjdk-headless tar wget
java -versionStep 2: Download and unpack OrientDB
Check the OrientDB releases page for the current 3.2 version and put it in a variable. The community edition tarball is served from Maven Central:
VER=3.2.58
cd /tmp
wget https://repo1.maven.org/maven2/com/orientechnologies/orientdb-community/${VER}/orientdb-community-${VER}.tar.gzCreate a system account without a login shell, unpack the archive into /opt/orientdb and hand the directory to that account:
sudo useradd --system --home-dir /opt/orientdb --shell /sbin/nologin orientdb
sudo mkdir -p /opt/orientdb
sudo tar -xzf orientdb-community-${VER}.tar.gz -C /opt/orientdb --strip-components=1
sudo chown -R orientdb:orientdb /opt/orientdbThe directories you will use most are bin/ (server.sh, console.sh), config/ (orientdb-server-config.xml), databases/ and log/.
Step 3: Start once to set the root password
OrientDB has its own root account, unrelated to the Linux one. On the first start the server asks for its password unless the ORIENTDB_ROOT_PASSWORD environment variable is set. Start the server in the foreground as the service account:
sudo -u orientdb /opt/orientdb/bin/server.shType a strong password when prompted and confirm it. Wait until the log reports that the server is active, then stop it with Ctrl+C. The password is stored hashed in config/orientdb-server-config.xml, so later starts do not ask again.
Step 4: Run OrientDB as a systemd service
The distribution ships a unit template in bin/orientdb.service with placeholders for the user, group and path. Create the finished unit directly as /etc/systemd/system/orientdb.service:
[Unit]
Description=OrientDB Server
After=network.target
After=syslog.target
[Service]
User=orientdb
Group=orientdb
ExecStart=/opt/orientdb/bin/server.sh
# Uncomment and adjust on servers with less than 4 GB of RAM
#Environment="ORIENTDB_OPTS_MEMORY=-Xms512M -Xmx512M"
LimitNOFILE=65536
Restart=on-failure
[Install]
WantedBy=multi-user.targetReload systemd, then enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now orientdb.service
sudo systemctl status orientdb.serviceFollow the server log if the service does not stay up:
sudo journalctl -u orientdb.service -fStep 5: Reach Studio and the binary port safely
OrientDB listens on two ports: 2424 for the binary protocol used by drivers and the console, and 2480 for HTTP, which serves the REST API and Studio. Confirm both are open locally:
sudo ss -tlnp | grep -E '2424|2480'Do not publish these ports to the whole internet. The simplest safe way to use Studio is an SSH tunnel from your workstation:
ssh -L 2480:127.0.0.1:2480 deploy@203.0.113.10Then open http://localhost:2480 and sign in as root with the password from Step 3. If application servers on other hosts need the database, open the ports in firewalld for their addresses only:
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="198.51.100.20" port port="2424" protocol="tcp" accept'
sudo firewall-cmd --reloadStep 6: Create a database from the console
Start the console as the service account:
sudo -u orientdb /opt/orientdb/bin/console.shAt the orientdb> prompt, create a database on the running server, add a class and a record, and read it back. Replace YourRootPassword with your own:
CREATE DATABASE remote:localhost/demo root YourRootPassword PLOCAL
CREATE CLASS Person EXTENDS V
INSERT INTO Person SET name = 'Ada'
SELECT FROM Person
QUITThe new database appears under /opt/orientdb/databases/demo and in Studio's database list. Create a separate database user for each application instead of connecting as the server's root.
Upgrades and backups
Patch releases within 3.2 are installed by replacing the program files while keeping databases/ and config/. Stop the service, copy those two directories somewhere safe, unpack the new tarball over /opt/orientdb, restore your configuration if it was overwritten, fix ownership with chown -R orientdb:orientdb /opt/orientdb and start the service. Read the release notes first: for example, release 3.2.55 tightened checks on CUSTOM values.
For a consistent backup while the server is offline, archiving the databases/ directory is enough. For online exports, use the console's EXPORT DATABASE command described in the OrientDB documentation.
Alternative: run the official Docker image
If you already use Docker, the official orientdb image avoids managing Java yourself. Bind the ports to the loopback interface and keep data in volumes:
docker run -d --name orientdb \
-p 127.0.0.1:2424:2424 -p 127.0.0.1:2480:2480 \
-e ORIENTDB_ROOT_PASSWORD=YourRootPassword \
-v orientdb-databases:/orientdb/databases \
-v orientdb-backup:/orientdb/backup \
orientdb:3.2Frequently asked questions
The service fails to start with an out-of-memory error. What now?
The default heap is 2 GB, which a 2 GB server cannot provide. Set ORIENTDB_OPTS_MEMORY in the unit file as shown in Step 4, run sudo systemctl daemon-reload and restart the service. OrientDB also uses memory outside the heap for its disk cache, so leave headroom rather than giving the heap all the RAM.
I forgot the OrientDB root password. How do I reset it?
Stop the service, remove the root entry from the <users> section of /opt/orientdb/config/orientdb-server-config.xml, and start the server once in the foreground as in Step 3. It asks for a new password and writes a fresh entry.
Which Java version should I use?
The 3.2 branch is compiled for Java 8 and declares Java 8 or newer as its requirement. Any OpenJDK long-term-support release packaged by AlmaLinux 9 or Rocky Linux 9 meets that; stay on one the distribution still updates.
Is the Community Edition enough for production?
It is the full database engine under the Apache 2 licence, including Studio and the console. What you have to supply yourself is the operational side: monitoring, tested backups and restricted network access.