The given hostname does not exist in the config

I’m trying to create user:
prosodyctl register user01 passXXX
I get result:
The given hostname does not exist in the config
Where need search error? Where hostname “” will be configured?

For my case i did this and it worked:
create and open a new repository file with your text editor.
sudo nano /etc/apt/sources.list.d/prosody.list
add this line: deb bionic main
download and install prosody APT key:
add Prosody’s key to APT’s keyring:
sudo apt-key add prosody-debian-packages.key
You can now delete the key as you no longer need it:
rm prosody-debian-packages.key
sudo apt update

so now i install the Prosody server package and some additional optional packages
sudo apt install prosody prosody-modules lua-dbi-sqlite3 lua-event
now i configured prosody
Make a copy of the configuration file with the cp command, just incase:
sudo cp /etc/prosody/prosody.cfg.lua /etc/prosody/prosody.cfg.lua.original
Open the configuration file:
sudo nano /etc/prosody/prosody.cfg.lua

look through and find admins = { } then add your admins like below
admins = { "admin@conference.your-domain", "queenmars@conference.your-domain" }
then remove – from the --VirtualHost “localhost” like below:
VirtualHost "yourdomain"

add a chat server:
VirtualHost "conference.your-domain"
ssl = {

save, ctrl + O and exit, ctrl + x
restart prosody to effect the new configurations:
sudo systemctl restart prosody.service

now add prosody users:
sudo prosodyctl register queenmars conference.your-domain password

you can allow prosody traffic through firewall if you didn’t do it
sudo ufw allow 5222,5322/tcp

That worked for me, it might work for you as well.