3 C
Amsterdam

How to install RavenDB on Ubuntu 20.04?

angeloma
angeloma
Senior Writer and partner

Hello, friends. In this post, you will learn how to install RavenDB on Ubuntu 20.04. If you are a developer or you are thinking to start in this world, you will find this post very interesting.

RavenDB is a NoSQL database manager written in C#. With a RavenDB database, you can set up a NoSQL data architecture or add a NoSQL layer to your current relational database.

Many companies rely on the potential of RavenDB, such as Toyota or Verizon, which gives us an idea of its data management capabilities.

With RavenDB you can handle data in the form of documents like others but with a lot of solvency and with an emphasis on performance. It can also be integrated with relational databases.

Install RavenDB on Ubuntu 20.04

Thanks to the great support provided by RavenDB it is possible to install it without much hassle.

So, open a terminal and update APT.

sudo apt update

Then install the apt-transport-https package that we will need later on.

sudo apt install apt-transport-https

Next, download a Microsoft package to install .NET core.

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

And proceed to install the downloaded package:

sudo apt install ./packages-microsoft-prod.deb

Refresh APT again to apply the changes to the software sources

sudo apt update

Now install .NET core:

sudo apt install aspnetcore-runtime-3.1

After this, we can download RavenDB using the wget command

wget https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest -O ravendb.tar.bz2
--2021-02-12 15:20:32--  https://hibernatingrhinos.com/downloads/RavenDB%20for%20Linux%20x64/latest
Resolving hibernatingrhinos.com (hibernatingrhinos.com)... 35.209.133.255
Connecting to hibernatingrhinos.com (hibernatingrhinos.com)|35.209.133.255|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://daily-builds.s3.amazonaws.com/RavenDB-5.1.4-linux-x64.tar.bz2 [following]
--2021-02-12 15:20:33--  https://daily-builds.s3.amazonaws.com/RavenDB-5.1.4-linux-x64.tar.bz2
Resolving daily-builds.s3.amazonaws.com (daily-builds.s3.amazonaws.com)... 52.217.91.84
Connecting to daily-builds.s3.amazonaws.com (daily-builds.s3.amazonaws.com)|52.217.91.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 66149673 (63M) [application/octet-stream]
Saving to: ‘ravendb.tar.bz2’

ravendb.tar.bz2                            100%[=====================================================================================>]  63.08M  1.63MB/s    in 22s     

2021-02-12 15:20:56 (2.84 MB/s) - ‘ravendb.tar.bz2’ saved [66149673/66149673]

Then, decompress it to a safe location. I will opt for the home directory

tar xvjf ravendb.tar.bz2

And then assign the corresponding permission.

Inside the generated folder called RavenDB is a file called run.sh that when executed will start the program, but we will make some configurations before.

Configuring RavenDB before using it

As I said, if you run that file already RavenDB will run without problems, but it is better to create a new systemd entry for the program.

The main advantage of this is that we will be able to manage RavenDB as a service of the system, so starting it, stopping it, checking its status becomes very easy.

So, let’s do it. Open a new configuration file

sudo nano /etc/systemd/system/ravendb.service

And inside it, add the following :

[Unit]
Description=RavenDB v4.0
After=network.target

[Service]
LimitCORE=infinity
LimitNOFILE=65536
LimitRSS=infinity
LimitAS=infinity
User=angelo
Restart=on-failure
Type=simple
ExecStart=/home/angelo/RavenDB/run.sh

[Install]
WantedBy=multi-user.target
 
1.- Configuring the RavenDB service
1.- Configuring the RavenDB service

Replace the username which in this case is angelo. Save the changes and close the editor.

To apply the changes you have to refresh the list of services.

sudo systemctl daemon-reload

Before starting it we have to know the following, by default, RavenDB is prepared to run on localhost. So if you start it, to complete the installation you have to open a web browser and go to http://localhost:41105 but there are cases where it is convenient to run RavenDB on a server. If this is your case, then you have to configure some more things.

The RavenDB configuration file is very simple so open it but before modifying it create a backup

cp ~/RavenDB/Server/settings.json ~/RavenDB/Server/settings.json.bak
sudo nano ~/RavenDB/Server/settings.json

And add the following:

{
    "ServerUrl": "http://159.69.48.203:8080",
    "Setup.Mode": "Unsecured",
    "DataDir": "RavenData",
    "Security.UnsecuredAccessAllowed": "PublicNetwork",
    "ServerUrl.Tcp": "tcp://159.69.48.203:38888"
}
2.- Configuring RavenDB
2.- Configuring RavenDB

Replace 127.0.0.1 with the IP address of your server.

Save the changes and close the editor. Now start RavenDB

sudo systemctl start ravendb
sudo systemctl enable ravendb

And check the status of the service:

sudo systemctl status ravendb
● ravendb.service - RavenDB v4.0
     Loaded: loaded (/etc/systemd/system/ravendb.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-02-12 15:35:14 CET; 4s ago
   Main PID: 5839 (run.sh)
      Tasks: 24 (limit: 4567)
     Memory: 61.5M
     CGroup: /system.slice/ravendb.service
             ├─5839 /bin/bash /home/angelo/RavenDB/run.sh
             └─5876 ./Raven.Server --browser

Feb 12 15:35:16 osradar run.sh[5876]:       | |__) |__ ___   _____ _ __ | |  | | |_) |
Feb 12 15:35:16 osradar run.sh[5876]:       |  _  // _` \ \ / / _ \ '_ \| |  | |  _ <
Feb 12 15:35:16 osradar run.sh[5876]:       | | \ \ (_| |\ V /  __/ | | | |__| | |_) |
Feb 12 15:35:16 osradar run.sh[5876]:       |_|  \_\__,_| \_/ \___|_| |_|_____/|____/
Feb 12 15:35:16 osradar run.sh[5876]:       Safe by default, optimized for efficiency
Feb 12 15:35:16 osradar run.sh[5876]:  Build 51016, Version 5.1, SemVer 5.1.4, Commit f8d499a
Feb 12 15:35:16 osradar run.sh[5876]:  PID 5876, 64 bits, 2 Cores, Phys Mem 3.75 GBytes, Arch: X64
Feb 12 15:35:16 osradar run.sh[5876]:  Source Code (git repo): https://github.com/ravendb/ravendb
Feb 12 15:35:16 osradar run.sh[5876]:  Built with love by Hibernating Rhinos and awesome contributors!
Feb 12 15:35:16 osradar run.sh[5876]: +---------------------------------------------------------------+
3.- Service status
3.- Service status

So, let’s complete the installation.

Running RavenDB

Now open a web browser and if you configured RavenDB to run on a server, go to http://server-ip:8080/eula/index.html you will see the following:

On this screen, you have to accept the license terms.

4.- License Agreement
4.- License Agreement

Then, as we have configured RavenDB from its configuration file we will be able to access the dashboard.

5.- RavenDB main screen on Ubuntu 20.04
5.- RavenDB main screen on Ubuntu 20.04

So, enjoy it.

Conclusion

RavenDB is a professionally supported database manager that gives us the option to have an alternative to serious projects. That is why it is a good idea to know how to install it and from there to learn how to use it.

- Advertisement -

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Donate to Osradar

Latest article

x