Skip to content

Installing Wazuh on DigitalOcean's Ubuntu 22.04

kangwijen

3 min read

I spent two weeks trying to install Wazuh on an Ubuntu 22.04 instance hosted on DigitalOcean, where I could connect to the machine only through the terminal. The number of problems I encountered was nerve-wracking. After several attempts, I found a procedure that worked on my Ubuntu 22.04 cloud instance. This isn't a full guide, but it records the steps that worked for me.

Installing Xubuntu Desktop and XRDP

I wanted a GUI for viewing the Wazuh dashboard, so I installed Xubuntu and XRDP. Xubuntu is a desktop environment that uses lightweight XFCE instead of the usual GNOME. I tried the normal Ubuntu Desktop with GNOME, but it was very slow, and changing the configuration file didn't help. XRDP is RDP for Linux, which lets me connect to the remote Linux machine from my local Windows machine.

You need both to access the Wazuh dashboard through the remote Linux machine. You could connect to the Wazuh dashboard directly from your local machine and skip this process, but I haven't tested that method.

First thing you need to do is to check for updates & upgrades and install them. You can do that by typing the command below. I'll be using root for the whole process.

bash
apt upgrade -y && apt update -y

You'll then be asked to keep some settings or restart some processes, you just need to click enter (Unless you're not using the default settings). Then, you can install everything (copy and paste everything, not line by line).

bash
apt install xubuntu-desktop
apt install xrdp
adduser xrdp ssl-cert
echo "startxfce4" > ~/.xsession
chmod +x ~/.xsession
systemctl restart xrdp.service

The installation will take a while. You'll then be asked multiple times to restart any processes, you just need to click enter (Unless you're not using the default settings). You then can try connecting to the remote machine via RDP from your local machine.

16-2

Installing Firefox

Xubuntu Desktop doesn't have a pre-installed browser, so I installed Firefox. I then ran into another problem: I couldn't type anything in the browser. Other people have reported the same problem (opens in a new tab). You need to install Firefox as a .deb package rather than a snap package.

  1. Adding the Firefox repository
bash
add-apt-repository ppa:mozillateam/ppa
  1. Changing the installation process to prioritize installation of Firefox from apt (copy and paste everything, not line by line).
bash
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
  1. (Optional) Set auto updates.
bash
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
  1. You then can install Firefox.
bash
apt install firefox

You should connect to the machine via RDP to confirm if the Firefox is installed successfully and running normally.

17-2

Installing Wazuh

We then can install Wazuh using this command, as root.

bash
curl -sO https://packages.wazuh.com/4.4/wazuh-install.sh && sudo bash ./wazuh-install.sh -a

The installation will take a while. You'll be shown something like this in your terminal if the installation is a success:

bash
INFO: --- Summary ---
INFO: You can access the web interface https://<wazuh-dashboard-ip>
    User: admin
    Password: <ADMIN_PASSWORD>
INFO: Installation finished.

Try connecting to the Wazuh dashboard in Firefox on your remote machine by using the remote machine's IP address. Firefox will show a warning that the website isn't safe. Click "Advanced." and "Accept The Risk and Continue" to open the Wazuh dashboard, then log in with the credentials provided after the installation. Wazuh is now installed on your Ubuntu 22.04 instance.

18-1

Sources

Big thanks to the dudes below who helped me install everything with their tutorial. You should check them out if you need more information on certain things that I skipped.