First, log in to the server with the ubuntu user using the password on the panel.
Then type the following command and press enter.
sudo su
Then type the following command and press enter.
sudo visudo or nano /etc/sudoers
Add the following to the bottom line and save.
root ALL=(ALL) NOPASSWD: ALL
Set a password for the root user with the command below.
passwd root