Here I will show you how to change port from 2222 to 9999 in two steps.
Step One: DirectAdmin
To change port of my choice (e.g., 9999), I have to open directadmin.conf as follows
vi /usr/local/directadmin/conf/directadmin.conf
Change port from 2222 to 9999
port=9999
Save and exit vi
:wq
Step Two: CSF
Find and change ports in CSF (ConfigServer Security & Firewall). Open csf.conf
vi /etc/csf/csf.conf
Change as follows:
TCP_IN = "9999" TCP_OUT = "9999"
Save and exit vi
:wq
Restart the CSF firewall
csf -r
Then restart the DirectAdmin
service directadmin restart
You can do above task in login to DirectAdmin too.