change cPanel theme of account through command line

It is fairly simple to change the cPanel theme of an account through cPanel or WHM.

Change cPanel theme through cPanel:

If you are through cPanel, locate the ‘Switch Theme’ box ( usually on the top portion of the panel ) and change to the required theme from there.


Sometimes activating some themes may render cPanel blank or else hide the Switch Theme box in which case you will need WHM or Shell access to change the theme.

Change cPanel theme through WHM:

If you have WHM Access, navigate to Home » Account Functions » Modify an Account and select the account for which the theme is to be changed and click ‘Modify’. Now from the interface which follows, expand the dropdown corresponding for ‘cPanel Theme’ and change the theme to the required theme and ‘Save’ it.


But, is it possible to change it through Commandline.Yes, you can (if you have root access).  Sometimes it is necessary to change theme configured for multiple accounts which is not practical or else time consuming to do it for each account individually.

To change the theme only for all accounts

If you need to change the theme of all users who have configured a particular theme to another one, execute the bellow commands as root user.

root@server:~#cd /var/cpanel/users/

root@server:~#find . -type f -print0 | xargs -0 sed -i ‘s/RS=old_theme/RS=new_theme/g’

Be sure to replace the old_theme and new_theme with the themes you need. For eg: to change thepaper_lantern theme to x3, execute the command as below.

root@server:~#find . -type f -print0 | xargs -0 sed -i ‘s/RS=paper_lantern/RS=x3/g’

To change the theme only for one account

Open the file with cPanel username in the ‘/var/cpanel/users’ directory and change RS field with the new theme name which you want.

root@server:~#cd /var/cpanel/users/

root@server:~#vi username

root@server:~#find . -type f -print0 | xargs -0 sed -i ‘s/RS=paper_lantern/RS=x3/g’

The theme configured for the account should be changed now. 🙂

You may also like...

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.