To get started easily, the following lines may help:
cd /opt
apt update
apt install -y git cmake libhwloc-dev libuv1-dev libuvc-dev librust-openssl-dev
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build
cd xmrig/build
cmake ..
make -jxx # xx = Your CPU thread count
ln -s /opt/xmrig/build/xmrig /usr/local/bin/
Now we can just run xmrig. As an an example:
xmrig \
-a cryptonight \
-o stratum+tcp://randomxmonero.eu.nicehash.com:3380 \
-u <YourHolyWalletHash> \
-p <YourHolyPassword> \
--donate-level=5 \
--threads=4