Customizing login page

How to create a login page

Many webhosts want to make an easy one stop location for logging into DirectAdmin. This can be accomplished by adding a login form on your webpage. Replace with your domain. It's fairly simple to do, just add the following code to your website:

    *{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; }
    b { FONT-WEIGHT: bold; }
    .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; }
    td.list { BACKGROUND: #EEEEEE; white-space: nowrap; }
<table cellspacing=1 cellpadding=5>
    <td class=listtitle colspan=2>Please enter your Username and Password</td>
<form action="" method="POST" name="form">
<input type=hidden name=referer value="/">
<input type=hidden name=FAIL_URL value="">
<input type=hidden name=LOGOUT_URL value="">

    <td class=list align=right>Username:</td><td class=list><input type=text name=username></td>
    <td class=list align=right>Password:</td><td class=list><input type=password name=password></td>
    <td class=listtitle align=right colspan=2><input type=submit value='Login'></td>

Also included in this form are the optional FAIL_URL and LOGOUT_URL values. You can set them so that if a user enters a wrong username or password, the login_failed.html will be shown, and when they hit "Logout" from within DirectAdmin, they'll be taken to the logged_out.html page. You can change the values as needed. If you remove those 2 options, then the default DA settings will take over. Both the login_failed.html and logged_out.html would be stored on your own website, and not through DA (as set, in this example).

If you want the login page to go straight to a particular page, you can change the "referer" value from "/" to "/CMD_USER_STATS" for example, if you wanted it to go straight to the statistics page upon successful login.

A related feature exists to change the DirectAdmin Login page itself: in new window

How to change the appearance of login page

If a skin creates the file login.html in its top level directory, e.g.,


then whatever skin is set in the directadmin.conf for


will be searched for that login.html, and used if it exists.

The priority order is:

  1. /usr/local/directadmin/data/templates/custom/login.html
  2. /usr/local/directadmin/data/templates/login.html
  3. ${docsroot}/login.html
  4. internal login page

Similarly, you can now create your own skin's "login_images" path, e.g., /usr/local/directadmin/data/skins/enhanced/login_images/logo.png.

If you want to change the look of the login page when you access port 2222, use this feature to create your own login.html file: in new window

Also, if you need to host your own images on that login page, use this feature: in new window

Last Updated: