Installation: DEB Package



Downloading and Installing RavenDB

1. Download DEB Package

First, download the RavenDB DEB package for the version you want to install.
Find it here: https://ravendb.net/download

"Download DEB Package"

Download DEB Package


2. Install RavenDB

  • Open a terminal, navigate to the folder you downloaded the RavenDB DEB package to, and install it using: sudo apt install <package name>
    sudo apt install ./ravendb_5.3.102-0_amd64.deb

The same command, sudo apt install <package name>, is also used to Upgrade RavenDB.

  • The RavenDB service will be created and activated automatically.

    "Install RavenDB"

    Install RavenDB

  • To complete the setup process, connect the address suggested by the setup process.
    By default, the address is: http://127.0.0.1:53700

    If you only have SSH access:

    • Open these ports on the target machine:
      • Port 53700 (RavenDB setup)
      • Port 443 (RavenDB HTTPS server)
      • Port 38888 (RavenDB TCP server)
    • Set port tunneling through SSH:
      • Tunnel port 53700 from localhost of the target machine to localhost:8080 of the SSH client machine.
        ssh -N -L localhost:8080:localhost:53700 ubuntu@target.machine.com
      • If you connect using a key, provide it using the -i option.
        This will allow you to open the RavenDB Setup Wizard on http://localhost:8080 and proceed with the setup process.

3. Complete the setup

Connecting the RavenDB service will invoke the setup wizard.

"Setup Wizard"

Setup Wizard

  • The first choice you need to make, is whether to set RavenDB as a Secure Server or allow any client to connect and configure it.

    We strongly recommend that you set RavenDB as a secure server.

  • Find Here a step by step guide to the rest of the setup process.


4. Entering RavenDB Studio When Setup is Complete

RavenDB can be managed using the RavenDB Studio management GUI.
To open Studio, connect the RavenDB service from a browser.

To connect the service from a browser and open Studio:

The address used to connect the RavenDB service during the setup process is temporary, and will change when the process is done.

  • If RavenDB is installed insecurely, its default address will be: 127.0.0.1:8080
  • If RavenDB is installed securely, its address will be determined by the domain name you registered during setup, e.g.: https://a.raven.development.run:8080
"RavenDB Studio"

RavenDB Studio

Learn more about Studio here.

Upgrading RavenDB

To upgrade RavenDB:

  • Enter https://ravendb.net/download and download the DEB package for the version you want to upgrade to.

  • Open a terminal, navigate to the folder you downloaded the DEB package to, and install it using: sudo apt install <package name>

    sudo apt install ./ravendb_5.3.102-0_amd64.deb
    This is the same command used to install RavenDB in the first place, only this time it will upgrade the installed database without harming its settings and the data stored in it.

Removing RavenDB

To remove the installed RavenDB package, you need its name.
It is ravendb, you can use dpkg --list to confirm it.

"RavenDB Service"

RavenDB Service

RavenDB can be removed with or without purging the data stored in it and its settings.


Remove RavenDB and Leave its Data and Settings Intact

To remove RavenDB and leave its settings and data intact, use: sudo apt-get remove <package name>

sudo apt-get remove ravendb
"Leave Data and Settings Intact"

Leave Data and Settings Intact

Reinstalling RavenDB after removing it this way will restore its data and settings.


Remove RavenDB Completely

To remove RavenDB completely, purging its data and settings, use: sudo dpkg -P <package name>

sudo dpkg -P ravendb
"Purge Data and Settings"

Purge Data and Settings

Running this command requires no confirmation, and will remove your data and settings irrevocably.

File System Locations

Once installed, these are the locations used by RavenDB.

  • Settings
    /etc/ravendb/settings.json
  • Security settings (e.g. certificate)
    /etc/ravendb/security
  • Data
    /var/lib/ravendb/data
  • Logs
    /var/log/ravendb/logs
  • Audit logs
    /var/log/ravendb/audit
  • Binaries
    /usr/lib/ravendb
  • rvn link
    /usr/bin/rvn -> /usr/lib/ravendb/rvn
  • systemd unit file
    /lib/systemd/ravendb.service

Default Settings

The database settings are located in: /etc/ravendb/settings.json
Their default values are:

{
    // http://127.0.0.1:53700 during setup
    // http://127.0.0.1:8080 after setup for an insecure server
    // the registered domain URL after setup for a secure server
    "ServerUrl": "http://127.0.0.1:53700", 
    
    // "Initial" during setup 
    // "None" when Setup is done
    "Setup.Mode": "Initial", 

    // Audit logs definitions
    "Logs.RetentionTimeInHrs": 336, // Audit log retention time (14 days)
    "Security.AuditLog.Compress": true,
    "Security.AuditLog.RetentionTimeInHrs": "52560", // Security log retention time (6 years)

    // Use a Eula license
    "License.Eula.Accepted": true
}

Learn more about configuration variables here and in pages that describe specific configuration options (e.g. Security Configuration).

RavenDB Service Definitions

The RavenDB service is defined here: /lib/systemd/ravendb.service
Its default values are:

[Unit]
Description=RavenDB NoSQL Database

# Run after the network interfaces are up
After=network.target

[Service]

# Process limits  
LimitCORE=infinity 
LimitNOFILE=65535
LimitRSS=infinity
LimitAS=infinity
LimitMEMLOCK=infinity
TasksMax=infinity

# Run as user ravendb
User=ravendb

StartLimitBurst=0
Restart=on-failure

# Single-process application
Type=simple

TimeoutStopSec=300

# RavenDB directories
Environment="RAVEN_DataDir=/var/lib/ravendb/data"
Environment="RAVEN_Indexing_NugetPackagesPath=/var/lib/ravendb/nuget"
Environment="RAVEN_Logs_Path=/var/log/ravendb/logs"
Environment="RAVEN_Security_AuditLog_FolderPath=/var/log/ravendb/audit"
Environment="RAVEN_Security_MasterKey_Path=/etc/ravendb/security/master.key"
Environment="RAVEN_Setup_Certificate_Path=/etc/ravendb/security/server.pfx"
Environment="HOME=/var/lib/ravendb"

# Startup process
ExecStart=/usr/lib/ravendb/server/Raven.Server -c "/etc/ravendb/settings.json"

[Install]
WantedBy=multi-user.target