I installed Netbeans and tryed to access the server's manager using: (id/pass)manager/manager, admin/admin, system/password... None of them worked.
-
They are configured in some Tomcat config file. As far as I remember, it was not very hard to find. – Carlos Sep 30 '10 at 09:59
-
NetBeans IDE uses a separate set of configuration files and not the
/conf directory, please refer my answer below for the solution – Tushar Joshi Oct 03 '10 at 12:48 -
NetBeans creates credentials in the Catalina Base (see http://tshikatshikaaa.blogspot.nl/2012/07/about-user-login-password-of-netbeans.html) – Jérôme Verstrynge Jul 28 '12 at 21:26
-
1possible duplicate of [How do I set Tomcat Manager Application User Name and Password for NetBeans?](http://stackoverflow.com/questions/1321933/how-do-i-set-tomcat-manager-application-user-name-and-password-for-netbeans) – Ciro Santilli OurBigBook.com Dec 08 '14 at 10:24
19 Answers
Check the file in <TOMCAT_HOME>/conf
named tomcat-users.xml
.
If you don't find something there edit to look something like:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="admin"/>
<user username="admin" password="password" roles="standard,manager,admin"/>
</tomcat-users>

- 87,898
- 29
- 167
- 228

- 22,068
- 12
- 57
- 89
In Tomcat 7 you have to add this to tomcat-users.xml (On windows 7 it is located by default installation here: c:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\ )
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>
NOTE that there shouldn't be ANY spaces between roles for admin, as this list should be comma separated.
So, instead of this (as suggested in some answers:
<user username="admin" password="admin" roles="manager-gui, manager-script, manager-jmx, manager-status, admin-gui, admin-script"/>
it MUST be like this:
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

- 7,238
- 14
- 83
- 113
-
Thanks, it really helps. One things I want to mention here that I face is first stop server then made any changes else when you stop server the server automatically discard the changes and our added credentials will not work. I face this issue, I know this sounds crazy but I did. – asifaftab87 Dec 04 '15 at 13:36
-
My answer is tested on Windows 7 with installation of NetBeans IDE 6.9.1 which has bundled Tomcat version 6.0.26. The instruction may work with other tomcat versions according to my opinion.
If you are starting the Apache Tomcat server from the Servers panel in NetBeans IDE then you shall know that the Catalina base and config files used by NetBeans IDE to start the Tomcat server are kept at a different location.
Steps to know the catalina base directory for your installation:
- Right click on the Apache Tomcat node in Servers panel and choose properties option in the context menu. This will open a dialog box named Servers.
- Check the directory name of the field Catalina Base, this is that directory where the current
conf/tomcat-users.xml
is located and which you want to open and read.
(In my case it isC:\Users\Tushar Joshi\.netbeans\6.9\apache-tomcat-6.0.26_base
) - Open this directory in
My Computer
and go to the conf directory where you will find the actualtomcat-users.xml
file used by NetBeans IDE. NetBeans IDE comes configured with one default password withusername="ide"
and some random password, you may change this username and password if you want or use it for your login also - This dialog box also have username and password field which are populated with these default username and password and NetBeans IDE also offers you to open the manager application by right clicking on the manager node under the Apache Tomcat node in Servers panel
- The only problem with the NetBeans IDE is it tries to open the URL
http://localhost:8084/manager/
which shall behttp://localhost:8084/manager/html
now

- 3,899
- 8
- 37
- 45

- 2,206
- 21
- 20
-
3Under Linux, this file is located at `/usr/local/apache-tomcat-
/conf/tomcat-users.xml`. – kazy Aug 27 '14 at 21:01 -
1if you installed using apt, then its at /usr/share/tomcat9/etc/tomcat-users.xml – Shankara Narayana Jun 21 '20 at 14:55
In Tomcat 7, 8, and 9 there is NO default user, so nobody can access a Manager app. You need to alter conf/tomcat-users.xml by adding new user with the role "manager-gui", like:
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
Look up here: https://www.mkyong.com/tomcat/tomcat-default-administrator-password/

- 1,243
- 3
- 17
- 37
Go to "%TOMCAT_FOLDER%/conf/tomcat-users.xml" and configure the following :
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manager-gui,manager-script"/>
</tomcat-users>
Hence, the username is "admin" and password is "admin"

- 7,469
- 1
- 12
- 11
-
This is the only answer here that worked for me. Careful though, you need to finish the roles attribute off with a double-quote. `
` – Lucas Aug 13 '16 at 04:44
Open tomcat-users.xml
which should be in C:\Tomcat 7.0\conf
Add following lines in above file :
<tomcat-users>
<role rolename="manager-gui"/>
<user username="admin" password="" roles="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="s3cret" roles="admin-gui"/>
</tomcat-users>
Note :
admin-gui
-> Username & Password - Do not Change.manager-gui
-> you can change user name & password for this only. [Here password is not given]

- 3,899
- 8
- 37
- 45

- 91
- 1
- 1
Only this helped me:
To use the web administration gui you have to add the gui role :
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<user username="name" password="pwd" roles="admin,admin-gui,manager,manager-gui"/>

- 21
- 1
First navigate to below location and open it in a text editor
<TOMCAT_HOME>/conf/tomcat-users.xml
For tomcat 7, Add the following xml code somewhere between <tomcat-users>
<role rolename="manager-gui"/>
<user username="username" password="password" roles="manager-gui"/>
Now restart the tomcat server.

- 16,415
- 8
- 80
- 90
In Tomcat 7, under TOMCAT_HOME/conf/tomcat_users.xml
, see the <user />
tag to see password.
Example:
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>

- 87,898
- 29
- 167
- 228
-
Still got problems. tomcat_users.xml contains this:
-
Netbeans install it's own Tomcat. Make sure you configured the config (xml) that is found in the Netbeans side. – Buhake Sindi Oct 01 '10 at 21:53
in file /conf/tomcat-users.xml
check or add:
......
<role rolename="manager"/>
<user username="ide" password="ide" roles="manager,tomcat,manager-script"/>
</tomcat-users>

- 9,895
- 3
- 50
- 69
Platform NetBeans 7.3, Apache Tomcat 7.0.34 re: Tomcat Manager
I spent 3 days tracking this down because I thought I had a bad install.
On Windows and Linux, NetBeans uses a separate file location for CATALINA_BASE:
http://wiki.netbeans.org/FaqInstallationDefaultTomcatPassword
So you can modify the tomcat_user.xml under CATALINA_HOME: until your face turns blue, to no effect.
It appears that the IDE only requires, manager-script,admin roles under CATALINA_BASE:.
When I tried to add a user to the manager-gui role (to the correct tomcat_user.xml file), required for access to the Tomcat Manager, Tomcat stopped presenting the login dialog and went directly to the 401 access denied splash page.
It appears that the NetBeans package uses a locked-down version of TomCat.
I hope this saves everyone some time.

- 29
- 4
For Window 7, Netbeans 8.0.2 , Apache Tomcat 8.0.15
C:\Users\JONATHAN\AppData\Roaming\NetBeans\8.0.2\apache-tomcat-8.0.15.0_base\conf\tomcat-users.xml
The Tomcat Manager Username and password is like below pic..

- 2,079
- 4
- 20
- 31
Look in your conf/tomcat-users.xml
. If there is nothing there, you'd have to configure it.

- 588,226
- 146
- 1,060
- 1,140
Well, you need to look at the answers above, but you'll find that the manager app requires you to have a user with the role 'manager', I believe, so you'll probably want to add the following to your tomcat-users.xml file:
<role rolename="manager"/>
<user username="youruser" password="yourpass" roles="manager"/>
This might seem simplistic, but it's just a simple implementation that you can extend / replace with other authentication mechanisms.

- 1,549
- 15
- 25
If people still have problems after adding/modifying the tomcat-users.xml file and adding the relevant user/role for the version of Tomcat that they're using then please be sure that you've removed the comment tags that are surrounding this block. They will look like this in the XML file:
<!--
-->
They will be above and below the user/role section.

- 1
If your apache tomcat asking for password,then just follow these steps: go to the home directory of apache then go to webapps folder open the META-INF inside that you will find an xml file named context.xml--open it in edit mode
and REMOVE THE COMMENT FROM the VALVE tag.
After that you dont need any user name and password.

- 4,757
- 1
- 48
- 55
In conf/tomcat-users.xml you can see what's your actual user configuration, in my case is usually user="admin" and pass="1234"

- 463
- 3
- 12
Check the file in <TOMCAT_HOME>/conf named tomcat-users.xml. If you don't find something there edit to look something like:
You can access in tomcat Manager-App and Host-Manager. add two role in one line
<role rolename="manager-gui,admin-gui"/>
<user username="admin" password="admin" roles="standard,manager-gui,admin-gui"/>

- 139
- 2
- 10