How to change Direct admin’s default port number?

Direct Admin

It is also a commonly using and famous web hosting control panel for Linux servers. It’s a paid one, not an open source control panel. You can access your direct admin control panel by using the port number 2222 by default.

If you want, there is an option to change the default port number. Here, CryBit going to explain the steps to change the default port number to a different one.

directadmin-logo-crybitimg

How to change Direct admin’s default port number?

You can simply change the default port number 2222 via command line. Certainly, this can be done by editing some configuration file. The port number is defined in the configuration file of Direct Admin (directadmin.conf). You can change the port value from that conf file.

Please do the following steps pasted below:

Step 1: SSH to your server as root user.

[root@localhost #] ssh root@IpAddr

Step 2: Edit the configuration file and change the port number value to your own one. You can use your favorite text editor like vi, vim, nano etc to edit the configuration file.

[root@testvps #] vim /usr/local/directadmin/conf/directadmin.conf
port=2222  

:wq

You need to edit this file also ‘/var/www/html/redirect.php‘. Replace the old port number with the new one.

Here 2222 is the default port number. Replace it with the new one.

Step 3: Restart the Direct Admin daemon

[root@server #] service directadmin restart

That’s it!

Now try to access with the new port number which you added into the configuration file.

Let me know if you have any questions.

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

13 thoughts on “How to change Direct admin’s default port number?

Leave a Reply

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