What is Tomcat default administrator password ?

Is there or what is the default administrator user and password for Tomcat?

Tested :

  1. Tomcat 8.0.30
  2. Tomcat 7.0.67
  3. Tomcat 6.0.44

Article update history

  1. Updated 03/02/2016 : Add support for Tomcat 7 and 8.
  2. Updated 08/04/2011 : Update article.

1. Tomcat 7 and Tomcat 8

Tomcat users are defined in the file – $TOMCAT_HOME/conf/tomcat-users.xml, by default, there is NO user, it means no one can access the Tomcat manager page.

To enable users to access the Tomcat manager page, add a user as the role manager-gui.

$TOMCAT_HOME/conf/tomcat-users.xml (Original)

<tomcat-users>
<!--
  <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"/>
-->
</tomcat-users>
$TOMCAT_HOME/conf/tomcat-users.xml (Updated)

<tomcat-users>
<!--
  <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"/>
-->

	<role rolename="manager-gui"/>
	<user username="admin" password="admin" roles="manager-gui"/>

</tomcat-users>

Saved it and restart Tomcat, now you should able to access the default manager page (http://localhost:8080/manager) with user = “admin” and password = “admin”

Note
Please refer to this official Tomcat Manager App HOW-TO

2. Tomcat 6

For Tomcat 6, add a user as the role manager

$TOMCAT_HOME/conf/tomcat-users.xml (Updated)

<tomcat-users>

  <role rolename="manager"/>
  <user username="admin" password="admin" roles="manager"/>

</tomcat-users>
Note
This “manager” role is deprecated, and removed since Tomcat 7.

References

  1. Tomcat Manager App HOW-TO
  2. Maven – deploy web application to Tomcat

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

Leave a Reply

avatar
newest oldest most voted
Agus Cardeilhac
Guest
Agus Cardeilhac

Hi !. I am writing you from Córdoba, Argentina. I am placing the same Xml Content in the tomcat-users file and I am still being rejected and get a 401 invalid credentials or unauthorized… I am under tomcat 7… Is there any other thing to configure in order to get into the manager console and deploy an app ?.
Thankx

sanjeeev kumar
Guest
sanjeeev kumar

thanku very much

esmaeill
Guest
esmaeill

thank you

Luis
Guest
Luis

this helped me, thanks.

Vaibhav Reddy
Guest
Vaibhav Reddy

Thanks it helped :)

sreekumar
Guest
sreekumar

it worked for me,thanks

Roberto Góes
Guest
Roberto Góes

Thanks!

renaissance
Guest
renaissance

thanks for the info

robert
Guest
robert

mkyong thanx for a wonderful help, here is the one i tried.

Open in notepad, and just erase everything you have in tomcat-users.xml file and paste these lines.

 
<?xml version='1.0' encoding='cp1252'?>
<tomcat-users>
  <role rolename="manager-gui"/>
  <user username="tomcat" password="s3cret" roles="manager-gui"/>
</tomcat-users>

 

hope it will work :)

vikaks
Guest
vikaks

When i save then is give a message Access denied means unable to save……what to do tell me

Bar
Guest
Bar

hmm not posting
role rolename=”manager-gui”
role rolename=”admin-gui”
user username=”admin” password=”admin” roles=”admin-gui, manager-gui”

Bar
Guest
Bar

Hi
still struggling with it. spend few days on internet but still no luck
is there a way to troubleshoot?
my OS
Windows
my Tomcat is:
Apache Tomcat/8.0.14
my tomcat-users.xml:

in my context.xml locking to local host is commented out
in my server.xml following uncommented
<Resource name="UserDatabase" auth="Container"
.
and
<Realm className="org.apache.catalina.realm.LockOutRealm"
.
by one of suggestions created
D:Tomcat80_4confCatalinalocalhostmanager.xml

still getting 401

appreciate any suggestion

Regards

Bar
Guest
Bar

missed to post users xml

Miguel
Guest
Miguel

MIchisimas gracias

Bor
Guest
Bor

Thanks a lot!!!!!!

Jaskirat Bamrah
Guest
Jaskirat Bamrah

As after above code I was still note able to get my Application Manager/ App manager Then Change the role

so, can also set this code as (this below code worked for me)

manager-gui — Access to the HTML interface.

manager-status — Access to the “Server Status” page only.

manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the “Server Status” page.

manager-jmx — Access to JMX proxy interface and to the “Server Status” page.

mkyong
Guest
mkyong

Thanks, fixed and updated.

Harsh
Guest
Harsh

add a role manager-gui to the list.

CYRIL YOHANNAN
Guest
CYRIL YOHANNAN

I installed tomcat in my Virtual Private Server in godaddy. Now I tried to access to Tomcat Host Manager using url: http://myServerIP:8080
But I dont know the username and password for the same. How to get the username and password to login to host manager? Is there any default password.? Please help. I’m in real trouble.

srikanth parimi
Guest
srikanth parimi

As you said I added few users that’s working fine but up to how many maximum users i can add for tomcat manager to log in.

zoyeb
Guest
zoyeb

<!–

–>

note:replace the entire text except this (note) USERNAME:tomcat PASSWORD:s3cret

Skender Kollcaku
Guest
Skender Kollcaku

Hi,
My name is Skender Kollcaku.
here is the xml I saved with the Vi editor under Debian:

<!–

–>

Hope it helps you!
Sk

Sergio
Guest
Sergio

It works, thanks!

Muza Izama
Guest
Muza Izama

it work… thanks so mch,,,,,,

silverxmay
Guest
silverxmay

this worked for me too

Bipin Kumar
Guest
Bipin Kumar

it worked – Thanks . the key is will not work – will work

asd
Guest
asd

try this ..its working for me
replace entire file ..
i have windows 7 ..apache 7.

Cláudia Cristina da Silva
Guest
Cláudia Cristina da Silva

thanks.

karthickeyan ganesan
Guest
karthickeyan ganesan

thankas

Azhar Mohamed
Guest
Azhar Mohamed

Yes this helped me to as manager alone would not load, so changed to rolename=manager-gui

Ucup Timposu
Guest
Ucup Timposu

yes… its work..

Anshul Sood
Guest
Anshul Sood

Thank you Mkyong!

Ali
Guest
Ali

Thank You mkyong.

mehdi
Guest
mehdi
thinks a lot for all your tips, but i still have a problem ———————————————————- 403 Access Denied You are not authorized to view this page. If you have already configured the Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site request forgery (CSRF) protection that has been enabled for the HTML interface of the Manager application. You will need to reset this protection by returning to the main Manager page. Once you return to this page, you will be able to continue using… Read more »
nadim
Guest
nadim

when i am updating xml file. it show an error message, telling that access to tomcat-user.xml was denied. pls tell, why it is happening?

blumonkey
Guest
blumonkey

Did you use sudo to edit the file?

manuxx
Guest
manuxx

Thanks a lot!

anthony
Guest
anthony

It’s nearly impossible to find educated people for this topic, however, you seem like you know what you’re talking about!
Thanks

robert
Guest
robert

here are the lines. something went wrong earlier.

Open in notepad, and just erase everything you have in tomcat-users.xml file and paste these lines.

hope it will work :)

robert
Guest
robert

mkyong thanx for a wonderful help, here is the one i tried.

Open in notepad, and just erase everything you have in tomcat-users.xml file and paste these lines.

save the file, restart it, i hope it will work :)

yashan
Guest
yashan

user is tomcat
password is password
this line xml comments sometime your command chainging a cmment using good for programer notepad is good one or other highlighters not using a word or notepad

trackback
Jak zwi?kszy? bezpiecze?stwo swojej webaplikacji – kilka prostych metod

[…] domy?lnej instalacji popularnego portalu Liferay albo domy?lne has?a dla serwerów aplikacyjnych Tomcat, Jboss, Websphere AS – przyk?ady mo?na […]

ravi
Guest
ravi

thanks a lot…. :)