Set up an username and password for Orthanc

Hello, guys

I have installed the Orthanc server on my Ubuntu 24.04 TLS via the apt install Orthan command. After modifying some parameter in /etc/orthanc/orthanc.json file we can access Orthanc server through the tcp 8042 port with the default username and password.

I searched the Internet and tried chatbots for how we can set up a non-default user account of Orthanc server but they were all not working. These codes did not work.

“RegisteredUsers” : {
“user1” : “password1”,
“user2” : “password2”
},

Therefore, I would like to know your ideas. Many thanks.

Hello and welcome,

Have you tried to set RemoteAccessAllowed to True?

see:
https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.4/OrthancServer/Resources/Configuration.json#l216

HTH,

Hello, pal

Thank you for your reply.

Yes, I set it as true at the line 218th of the file /etc/orthanc/orthanc.json

Regards,

Hello,

Here is a minimal configuration file that works:

{
  "RemoteAccessAllowed" : true
}

The default username is orthanc and the password is orthanc.

Regards,
Sébastien-

Hi, @jodogne

Thanks for the suggestion but I would like to use cutomized username and password.

Regards,

Tom

This is actually the correct way to do it so it seems your configuration file is not taken into account.

The easiest way to check if your file is read by Orthanc is to make it invalid and restart Orthanc → Orthanc should fail to start…

HTH,

Alain

Hi, Alain

Thanks for the tip and I will try your method later. But I am pretty sure the configure file is working because it became invalid with uncorrect configurations.

Regards,

The Orthanc service failed to start with this,

"RegisteredUsers" : {
"user1" : "password1"
}

Figured it out. Having put the lines into /etc/orthanc/orthanc.json. The correct file is /etc/orthanc/credentials.json.