Skip to content

Add user to Wildfly

Last Updated on 11/11/2020

Wildfly user logo

This tutorial will show how to add a user to Wildfly, so that this new user can manage the application server.

Pre-requisites

User

Before continue, make sure your Wildfly is started.

Usually, when accessing your administrative page for the first time by the link http://localhost:8080/ and clicking Administration Console, it is possible that the Wildfly still has no users and the following message appears:

Wildfly complaining about no users has benn set

In this case, let’s create a new user so you can log in and manage the application server.

To begin, go to the bin directory of you Wildfly and run the command below:

cd /opt/wildfly-8.2.0.Final/bin
./add-user.sh

Next, you will be asked about that user type you want to create. The type we want is the Management User that is pre-defined already, so just hit Enter:

What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a):

On the next step you will choose an username. Type the desired username and hit Enter:

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : bgasparotto

Then you must choose a password, preferably following the listed recommendations:

Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password should be different from the username
Password :

Re-enter your password:

Re-enter Password :

On the next step, it will be proposed that you associate your new user to some group, however, we are not going to do that this time, so simply hit Enter:

What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:

A message asking for your confirmation will be displayed, type yes to confirm:

About to add user 'bgasparotto' for realm 'ManagementRealm'
Is this correct yes/no? yes

A series of messages will be displayed showing the locations where the user was added, lastly, it will be asked if the user is going to be used to connecting across the application server processes, type no to finish:

Added user 'bgasparotto' to file '/opt/wildfly-8.2.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'bgasparotto' to file '/opt/wildfly-8.2.0.Final/domain/configuration/mgmt-users.properties'
Added user 'bgasparotto' with groups  to file '/opt/wildfly-8.2.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'bgasparotto' with groups  to file '/opt/wildfly-8.2.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? no

Access the link http://localhost:9990/console/App.html and will be asked for a username and password. Type the username and password that you created, then you will be redirected to the administration console:

wildfly console home

Hope it helps. Cya!

8 thoughts on “Add user to Wildfly”

  1. I had a remote server for a user in my JBPM workbench , I removed the remote server .Could my remote server be reestablished by adding the user again ?

  2. WILLIAM DIOGO BRASIL

    To me appear a message when i execute add-user.bat:
    The system cannot find the path specified.
    Could you help me?

  3. Jonatan Duttweiler

    Add-user.sh just adds the user to mgmt-users.properties.
    If you’re working with Docker, a very useful approach is add the users what you want in this way, then copy the mgmt-users.properties.
    In this way, you can take a set of users to the wildfly containers you want, simply adding an instruction COPY in Dockerfile
    COPY ./mgmt-users.properties /opt/jboss/wildfly/domain/configuration/
    COPY ./mgmt-users.properties /opt/jboss/wildfly/standalone/configuration/

    Thanks for sharing your knowledge in this clear way! Nice post.

  4. C:\JAVAEE\wildfly-8.2.0.Final\wildfly-8.2.0.Final\bin>add-user.bat
    Le chemin d’accès spécifié est introuvable.
    Appuyez sur une touche pour continuer…

    j’ai pas compris cette erreur pourqoui

Leave a Reply

Your email address will not be published. Required fields are marked *