<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[AdminsForum - CloudPanel CLI (clpctl) & Automation Guides]]></title>
		<link>https://adminsforum.com/</link>
		<description><![CDATA[AdminsForum - https://adminsforum.com]]></description>
		<pubDate>Sun, 29 Nov 2026 09:28:01 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[clpctl Errors in CloudPanel: Command Not Found, Wrong User and Quoting Fixes]]></title>
			<link>https://adminsforum.com/Thread-guide-clpctl-errors-in-cloudpanel-command-not-found-wrong-user-and-quoting-fixes</link>
			<pubDate>Fri, 23 Oct 2026 17:36:57 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://adminsforum.com/member.php?action=profile&uid=1">JAY</a>]]></dc:creator>
			<guid isPermaLink="false">https://adminsforum.com/Thread-guide-clpctl-errors-in-cloudpanel-command-not-found-wrong-user-and-quoting-fixes</guid>
			<description><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">clpctl errors in CloudPanel: command not found, wrong user and quoting fixes</span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">clpctl</span> is CloudPanel's command-line tool. It's great for scripting and for emergencies (like resetting a lost password), but its error messages can be confusing. Most problems come from three things: running it as the wrong user, shell quoting, and typos in option names. New to clpctl? Start with <a href="https://adminsforum.com/Thread-guide-cloudpanel-getting-started-with-the-clpctl-command" target="_blank" rel="noopener" class="mycode_url">getting started with the clpctl command</a> and the <a href="https://adminsforum.com/Thread-guide-clpctl-cheat-sheet-useful-cloudpanel-commands-for-everyday-admin" target="_blank" rel="noopener" class="mycode_url">clpctl cheat sheet</a>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">The most important rule: root commands vs site user commands</span></span><br />
CloudPanel splits clpctl commands into two groups:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Root user commands</span> manage the whole server: adding sites (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>site:add:php</code></div></div> and friends), users (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>user:add</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>user:reset:password</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>user:disable:mfa</code></div></div>), databases (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:add</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:show:master-credentials</code></div></div>), certificates (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>lets-encrypt:install:certificate</code></div></div>), vhost templates and Basic Auth for the panel.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Site user commands</span> work on one site: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>system:permissions:reset</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:export</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:import</code></div></div> and <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>varnish-cache:purge</code></div></div>. (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:export</code></div></div> and <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:import</code></div></div> also exist as root commands.)<br />
</li>
</ul>
So: log in as <span style="font-weight: bold;" class="mycode_b">root</span> for panel-wide jobs, and as the <span style="font-weight: bold;" class="mycode_b">site user</span> (or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser</code></div></div> from root) for site jobs. Running a command as the wrong user is the most common reason clpctl "doesn't work".<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Error: "clpctl: command not found"</span></span><ul class="mycode_list"><li>Check you're on the CloudPanel server and not on your own computer or another VPS: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>hostname</code></div></div>.<br />
</li>
<li>Check the tool exists: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>which clpctl</code></div></div>. If it prints nothing as root, CloudPanel isn't installed correctly on this server.<br />
</li>
<li>If you switched user with plain <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su siteuser</code></div></div>, use <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser</code></div></div> (with the dash) so you get that user's full login environment.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Error: permission denied, or the command refuses to run</span></span><br />
You're the wrong user for that command. Use the list above. For site user commands, also <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>cd</code></div></div> into the site folder first when the command works on the current path, for example:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser
cd ~/htdocs/example.com
clpctl system:permissions:reset --directories=770 --files=660 --path=.</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Passwords with special characters break the command</span></span><br />
Characters like <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&amp;</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>;</code></div></div> and spaces mean something to the shell. Always put values in <span style="font-weight: bold;" class="mycode_b">single quotes</span>, as CloudPanel's own examples do:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:reset:password --userName='john.doe' --password='My!Strong&#36;Pass'</code></div></div>Inside single quotes, nothing is changed by the shell. Double quotes are <span style="font-style: italic;" class="mycode_i">not</span> safe for <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div>. If the password itself contains a single quote, pick a different password; it's not worth the trouble.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Option names are case-sensitive</span></span><br />
CloudPanel uses camelCase option names: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--domainName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--databaseName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--userName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--siteUser</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--phpVersion</code></div></div>. Writing <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--domainname</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--database-name</code></div></div> fails. Copy option names from the docs or the cheat sheet instead of typing them.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Error: site or domain not found</span></span><br />
Use the site's domain exactly as CloudPanel shows it in the site list: no <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>https://</code></div></div>, no trailing slash, and the same <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>www</code></div></div> or non-www form. If <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>www.example.com</code></div></div> is listed, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>example.com</code></div></div> won't match.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">db:import and db:export problems</span></span><ul class="mycode_list"><li>The file name decides the format: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>.sql.gz</code></div></div> is compressed, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>.sql</code></div></div> is plain.<br />
</li>
<li>Import from the folder where the dump is, or give the full path, and make sure the user running the command can read the file (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>ls -l dump.sql.gz</code></div></div>).<br />
</li>
<li>Big imports can take minutes. Let them finish; don't start a second one.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Before you script anything</span></span><br />
Run the command once by hand and check the result in the panel. Then put it in a cron job or script, and log the output so you can see failures:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:export --databaseName='my_db' --file="/home/siteuser/db-backups/my_db-&#36;(date +%F).sql.gz" &gt;&gt; /home/siteuser/db-backups/export.log 2&gt;&amp;1</code></div></div><br />
Still stuck? Post the exact command (with passwords replaced by XXX), the user you ran it as (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>whoami</code></div></div>) and the full error message.<br />
<br />
<span style="font-size: small;" class="mycode_size">Sources: <a href="https://cloudpanel.io/docs/v2/cloudpanel-cli/root-user-commands" target="_blank" rel="noopener" class="mycode_url">CloudPanel: root user commands</a> · <a href="https://www.cloudpanel.io/docs/v2/cloudpanel-cli/site-user-commands/" target="_blank" rel="noopener" class="mycode_url">CloudPanel: site user commands</a></span><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">More CloudPanel troubleshooting</span></span><ul class="mycode_list"><li><a href="https://adminsforum.com/Thread-guide-cloudpanel-installation-failed-common-install-errors-and-how-to-fix-them" target="_blank" rel="noopener" class="mycode_url">Installation failed: common install errors</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-can-t-log-in-to-cloudpanel-port-8443-lost-password-and-2fa-fixes" target="_blank" rel="noopener" class="mycode_url">Can't log in: port 8443, password and 2FA</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-site-shows-403-forbidden-or-404-not-found-how-to-fix-it" target="_blank" rel="noopener" class="mycode_url">Site shows 403 Forbidden or 404</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-too-many-redirects-or-mixed-content-after-ssl-how-to-fix" target="_blank" rel="noopener" class="mycode_url">Too many redirects or mixed content after SSL</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-php-extension-missing-in-cloudpanel-check-enable-ioncube-and-fix-errors" target="_blank" rel="noopener" class="mycode_url">PHP extension missing / enable ionCube</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-wordpress-on-cloudpanel-asks-for-ftp-details-or-can-t-update-plugins-fix" target="_blank" rel="noopener" class="mycode_url">WordPress asks for FTP or can't update plugins</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-varnish-cache-showing-old-pages-or-breaking-logins-how-to-fix" target="_blank" rel="noopener" class="mycode_url">Varnish showing old pages or breaking logins</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-how-to-restore-a-site-from-a-cloudpanel-backup-files-and-database" target="_blank" rel="noopener" class="mycode_url">Restore a site from a backup</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-ssh-or-sftp-login-fails-permission-denied-and-connection-errors" target="_blank" rel="noopener" class="mycode_url">SSH or SFTP login fails</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-node-js-app-on-cloudpanel-shows-502-or-keeps-restarting-pm2-fixes" target="_blank" rel="noopener" class="mycode_url">Node.js app shows 502 or keeps restarting</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-site-hacked-how-to-find-malware-clean-up-and-lock-it-down" target="_blank" rel="noopener" class="mycode_url">Site hacked: find malware and clean up</a><br />
</li>
</ul>
<br />
<span style="font-size: small;" class="mycode_size">Applies to CloudPanel v2 on Ubuntu and Debian, October 2026. Replace <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>example.com</code></div></div> with your domain and <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>siteuser</code></div></div> with your site's user name.</span>]]></description>
			<content:encoded><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">clpctl errors in CloudPanel: command not found, wrong user and quoting fixes</span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">clpctl</span> is CloudPanel's command-line tool. It's great for scripting and for emergencies (like resetting a lost password), but its error messages can be confusing. Most problems come from three things: running it as the wrong user, shell quoting, and typos in option names. New to clpctl? Start with <a href="https://adminsforum.com/Thread-guide-cloudpanel-getting-started-with-the-clpctl-command" target="_blank" rel="noopener" class="mycode_url">getting started with the clpctl command</a> and the <a href="https://adminsforum.com/Thread-guide-clpctl-cheat-sheet-useful-cloudpanel-commands-for-everyday-admin" target="_blank" rel="noopener" class="mycode_url">clpctl cheat sheet</a>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">The most important rule: root commands vs site user commands</span></span><br />
CloudPanel splits clpctl commands into two groups:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Root user commands</span> manage the whole server: adding sites (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>site:add:php</code></div></div> and friends), users (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>user:add</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>user:reset:password</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>user:disable:mfa</code></div></div>), databases (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:add</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:show:master-credentials</code></div></div>), certificates (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>lets-encrypt:install:certificate</code></div></div>), vhost templates and Basic Auth for the panel.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Site user commands</span> work on one site: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>system:permissions:reset</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:export</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:import</code></div></div> and <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>varnish-cache:purge</code></div></div>. (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:export</code></div></div> and <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:import</code></div></div> also exist as root commands.)<br />
</li>
</ul>
So: log in as <span style="font-weight: bold;" class="mycode_b">root</span> for panel-wide jobs, and as the <span style="font-weight: bold;" class="mycode_b">site user</span> (or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser</code></div></div> from root) for site jobs. Running a command as the wrong user is the most common reason clpctl "doesn't work".<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Error: "clpctl: command not found"</span></span><ul class="mycode_list"><li>Check you're on the CloudPanel server and not on your own computer or another VPS: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>hostname</code></div></div>.<br />
</li>
<li>Check the tool exists: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>which clpctl</code></div></div>. If it prints nothing as root, CloudPanel isn't installed correctly on this server.<br />
</li>
<li>If you switched user with plain <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su siteuser</code></div></div>, use <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser</code></div></div> (with the dash) so you get that user's full login environment.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Error: permission denied, or the command refuses to run</span></span><br />
You're the wrong user for that command. Use the list above. For site user commands, also <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>cd</code></div></div> into the site folder first when the command works on the current path, for example:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser
cd ~/htdocs/example.com
clpctl system:permissions:reset --directories=770 --files=660 --path=.</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Passwords with special characters break the command</span></span><br />
Characters like <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&amp;</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>;</code></div></div> and spaces mean something to the shell. Always put values in <span style="font-weight: bold;" class="mycode_b">single quotes</span>, as CloudPanel's own examples do:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:reset:password --userName='john.doe' --password='My!Strong&#36;Pass'</code></div></div>Inside single quotes, nothing is changed by the shell. Double quotes are <span style="font-style: italic;" class="mycode_i">not</span> safe for <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div>. If the password itself contains a single quote, pick a different password; it's not worth the trouble.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Option names are case-sensitive</span></span><br />
CloudPanel uses camelCase option names: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--domainName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--databaseName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--userName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--siteUser</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--phpVersion</code></div></div>. Writing <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--domainname</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--database-name</code></div></div> fails. Copy option names from the docs or the cheat sheet instead of typing them.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Error: site or domain not found</span></span><br />
Use the site's domain exactly as CloudPanel shows it in the site list: no <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>https://</code></div></div>, no trailing slash, and the same <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>www</code></div></div> or non-www form. If <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>www.example.com</code></div></div> is listed, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>example.com</code></div></div> won't match.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">db:import and db:export problems</span></span><ul class="mycode_list"><li>The file name decides the format: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>.sql.gz</code></div></div> is compressed, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>.sql</code></div></div> is plain.<br />
</li>
<li>Import from the folder where the dump is, or give the full path, and make sure the user running the command can read the file (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>ls -l dump.sql.gz</code></div></div>).<br />
</li>
<li>Big imports can take minutes. Let them finish; don't start a second one.<br />
</li>
</ul>
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Before you script anything</span></span><br />
Run the command once by hand and check the result in the panel. Then put it in a cron job or script, and log the output so you can see failures:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:export --databaseName='my_db' --file="/home/siteuser/db-backups/my_db-&#36;(date +%F).sql.gz" &gt;&gt; /home/siteuser/db-backups/export.log 2&gt;&amp;1</code></div></div><br />
Still stuck? Post the exact command (with passwords replaced by XXX), the user you ran it as (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>whoami</code></div></div>) and the full error message.<br />
<br />
<span style="font-size: small;" class="mycode_size">Sources: <a href="https://cloudpanel.io/docs/v2/cloudpanel-cli/root-user-commands" target="_blank" rel="noopener" class="mycode_url">CloudPanel: root user commands</a> · <a href="https://www.cloudpanel.io/docs/v2/cloudpanel-cli/site-user-commands/" target="_blank" rel="noopener" class="mycode_url">CloudPanel: site user commands</a></span><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">More CloudPanel troubleshooting</span></span><ul class="mycode_list"><li><a href="https://adminsforum.com/Thread-guide-cloudpanel-installation-failed-common-install-errors-and-how-to-fix-them" target="_blank" rel="noopener" class="mycode_url">Installation failed: common install errors</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-can-t-log-in-to-cloudpanel-port-8443-lost-password-and-2fa-fixes" target="_blank" rel="noopener" class="mycode_url">Can't log in: port 8443, password and 2FA</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-site-shows-403-forbidden-or-404-not-found-how-to-fix-it" target="_blank" rel="noopener" class="mycode_url">Site shows 403 Forbidden or 404</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-too-many-redirects-or-mixed-content-after-ssl-how-to-fix" target="_blank" rel="noopener" class="mycode_url">Too many redirects or mixed content after SSL</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-php-extension-missing-in-cloudpanel-check-enable-ioncube-and-fix-errors" target="_blank" rel="noopener" class="mycode_url">PHP extension missing / enable ionCube</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-wordpress-on-cloudpanel-asks-for-ftp-details-or-can-t-update-plugins-fix" target="_blank" rel="noopener" class="mycode_url">WordPress asks for FTP or can't update plugins</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-varnish-cache-showing-old-pages-or-breaking-logins-how-to-fix" target="_blank" rel="noopener" class="mycode_url">Varnish showing old pages or breaking logins</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-how-to-restore-a-site-from-a-cloudpanel-backup-files-and-database" target="_blank" rel="noopener" class="mycode_url">Restore a site from a backup</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-ssh-or-sftp-login-fails-permission-denied-and-connection-errors" target="_blank" rel="noopener" class="mycode_url">SSH or SFTP login fails</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-node-js-app-on-cloudpanel-shows-502-or-keeps-restarting-pm2-fixes" target="_blank" rel="noopener" class="mycode_url">Node.js app shows 502 or keeps restarting</a><br />
</li>
<li><a href="https://adminsforum.com/Thread-guide-cloudpanel-site-hacked-how-to-find-malware-clean-up-and-lock-it-down" target="_blank" rel="noopener" class="mycode_url">Site hacked: find malware and clean up</a><br />
</li>
</ul>
<br />
<span style="font-size: small;" class="mycode_size">Applies to CloudPanel v2 on Ubuntu and Debian, October 2026. Replace <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>example.com</code></div></div> with your domain and <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>siteuser</code></div></div> with your site's user name.</span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[clpctl Cheat Sheet: Useful CloudPanel Commands for Everyday Admin]]></title>
			<link>https://adminsforum.com/Thread-guide-clpctl-cheat-sheet-useful-cloudpanel-commands-for-everyday-admin</link>
			<pubDate>Mon, 19 Oct 2026 22:41:54 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://adminsforum.com/member.php?action=profile&uid=1">JAY</a>]]></dc:creator>
			<guid isPermaLink="false">https://adminsforum.com/Thread-guide-clpctl-cheat-sheet-useful-cloudpanel-commands-for-everyday-admin</guid>
			<description><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">clpctl cheat sheet: CloudPanel commands you'll actually use</span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">clpctl</span> is CloudPanel's command-line tool. Everything you click in the CloudPanel dashboard, like creating sites, databases and SSL certificates, you can also do with one line in the terminal. That's handy when the panel won't load, when you manage many sites, or when you want to script repeat jobs.<br />
<br />
This is a practical cheat sheet, grouped by task, with a short explanation for each command. Run them as <span style="font-weight: bold;" class="mycode_b">root</span> unless noted.<br />
<br />
In every example, replace <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>YOUR-STRONG-PASSWORD</code></div></div>, the domain and the user names with your own.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Tip:</span> to see every option for a command, add <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--help</code></div></div>, for example <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:php --help</code></div></div>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Locked out of the panel</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Reset a CloudPanel user's password</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:reset:password --userName=john.doe --password='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Turn off two-factor login for a user who lost their phone</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:disable:mfa --userName=john.doe</code></div></div><span style="font-weight: bold;" class="mycode_b">See all panel users</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:list</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Create sites</span></span><br />
<span style="font-weight: bold;" class="mycode_b">PHP site</span> (use <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl vhost-templates:list</code></div></div> to see template names such as Generic, WordPress or Laravel)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:php --domainName=www.example.com --phpVersion=8.4 --vhostTemplate='Generic' --siteUser=john --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Node.js site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:nodejs --domainName=app.example.com --nodejsVersion=22 --appPort=3000 --siteUser=appuser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Python site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:python --domainName=py.example.com --pythonVersion=3.12 --appPort=8090 --siteUser=pyuser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Static HTML site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:static --domainName=static.example.com --siteUser=staticuser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Reverse proxy</span> (for Docker containers or apps on another port)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:reverse-proxy --domainName=tool.example.com --reverseProxyUrl='http://127.0.0.1:8000' --siteUser=tooluser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Delete a site</span> (asks you to type "yes"; this removes the site's files)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:delete --domainName=www.example.com</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">SSL certificates</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Free Let's Encrypt certificate</span> (for <a href="http://www.example.com" target="_blank" rel="noopener" class="mycode_url">www.example.com</a> you automatically get example.com too)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl lets-encrypt:install:certificate --domainName=www.example.com</code></div></div><span style="font-weight: bold;" class="mycode_b">Add extra names to the same certificate</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl lets-encrypt:install:certificate --domainName=www.example.com --subjectAlternativeName=shop.example.com</code></div></div><span style="font-weight: bold;" class="mycode_b">Install your own certificate</span> (bought SSL or Cloudflare Origin)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:install:certificate --domainName=www.example.com --privateKey=/root/ssl/key.pem --certificate=/root/ssl/cert.pem</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Databases</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Create a database and user for a site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:add --domainName=www.example.com --databaseName=shop_db --databaseUserName=shop_user --databaseUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Export (backup) a database</span>, compressed because the name ends in .gz<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:export --databaseName=shop_db --file=shop_db.sql.gz</code></div></div><span style="font-weight: bold;" class="mycode_b">Import a database</span> (run it in the folder where the file is)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:import --databaseName=shop_db --file=shop_db.sql.gz</code></div></div><span style="font-weight: bold;" class="mycode_b">Show the MySQL master (root) login</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:show:master-credentials</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Protect the CloudPanel login</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Add an extra browser password in front of the panel</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudpanel:enable:basic-auth --userName=john.doe --password='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Remove it again</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudpanel:disable:basic-auth</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Cloudflare</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Refresh Cloudflare's IP list</span> (CloudPanel already does this daily; useful after you start using "Cloudflare only")<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudflare:update:ips</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Panel users</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Add an admin user</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:add --userName='jane' --email='jane@example.com' --firstName='Jane' --lastName='Doe' --password='YOUR-STRONG-PASSWORD' --role='admin' --timezone='UTC' --status='1'</code></div></div><span style="font-weight: bold;" class="mycode_b">Add a user who can only see certain sites</span> (great for clients)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:add --userName='client1' --email='client@example.com' --firstName='Client' --lastName='One' --password='YOUR-STRONG-PASSWORD' --role='user' --sites='example.com' --timezone='UTC' --status='1'</code></div></div><span style="font-weight: bold;" class="mycode_b">Delete a user</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:delete --userName='client1'</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Safety tips</span></span><ul class="mycode_list"><li>Put passwords in single quotes, especially if they contain <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div>, so the shell doesn't change them.<br />
</li>
<li>Commands with a password stay in your shell history. Clear it afterwards with <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>history -c</code></div></div> if other people use the server.<br />
</li>
<li>Always export a database before you import over it or delete a site.<br />
</li>
</ul>
<br />
<span style="font-size: small;" class="mycode_size">Sources (checked October 2026): <a href="https://www.cloudpanel.io/docs/v2/cloudpanel-cli/root-user-commands/" target="_blank" rel="noopener" class="mycode_url">CloudPanel CLI: root user commands</a> · <a href="https://www.cloudpanel.io/blog/cloudpanel-cli-interface/" target="_blank" rel="noopener" class="mycode_url">CloudPanel CLI interface</a></span><br />
<br />
New to clpctl? Start here: <a href="https://adminsforum.com/Thread-guide-cloudpanel-getting-started-with-the-clpctl-command" target="_blank" rel="noopener" class="mycode_url">Getting started with the clpctl command</a>]]></description>
			<content:encoded><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">clpctl cheat sheet: CloudPanel commands you'll actually use</span></span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">clpctl</span> is CloudPanel's command-line tool. Everything you click in the CloudPanel dashboard, like creating sites, databases and SSL certificates, you can also do with one line in the terminal. That's handy when the panel won't load, when you manage many sites, or when you want to script repeat jobs.<br />
<br />
This is a practical cheat sheet, grouped by task, with a short explanation for each command. Run them as <span style="font-weight: bold;" class="mycode_b">root</span> unless noted.<br />
<br />
In every example, replace <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>YOUR-STRONG-PASSWORD</code></div></div>, the domain and the user names with your own.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Tip:</span> to see every option for a command, add <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--help</code></div></div>, for example <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:php --help</code></div></div>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Locked out of the panel</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Reset a CloudPanel user's password</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:reset:password --userName=john.doe --password='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Turn off two-factor login for a user who lost their phone</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:disable:mfa --userName=john.doe</code></div></div><span style="font-weight: bold;" class="mycode_b">See all panel users</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:list</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Create sites</span></span><br />
<span style="font-weight: bold;" class="mycode_b">PHP site</span> (use <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl vhost-templates:list</code></div></div> to see template names such as Generic, WordPress or Laravel)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:php --domainName=www.example.com --phpVersion=8.4 --vhostTemplate='Generic' --siteUser=john --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Node.js site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:nodejs --domainName=app.example.com --nodejsVersion=22 --appPort=3000 --siteUser=appuser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Python site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:python --domainName=py.example.com --pythonVersion=3.12 --appPort=8090 --siteUser=pyuser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Static HTML site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:static --domainName=static.example.com --siteUser=staticuser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Reverse proxy</span> (for Docker containers or apps on another port)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:reverse-proxy --domainName=tool.example.com --reverseProxyUrl='http://127.0.0.1:8000' --siteUser=tooluser --siteUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Delete a site</span> (asks you to type "yes"; this removes the site's files)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:delete --domainName=www.example.com</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">SSL certificates</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Free Let's Encrypt certificate</span> (for <a href="http://www.example.com" target="_blank" rel="noopener" class="mycode_url">www.example.com</a> you automatically get example.com too)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl lets-encrypt:install:certificate --domainName=www.example.com</code></div></div><span style="font-weight: bold;" class="mycode_b">Add extra names to the same certificate</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl lets-encrypt:install:certificate --domainName=www.example.com --subjectAlternativeName=shop.example.com</code></div></div><span style="font-weight: bold;" class="mycode_b">Install your own certificate</span> (bought SSL or Cloudflare Origin)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:install:certificate --domainName=www.example.com --privateKey=/root/ssl/key.pem --certificate=/root/ssl/cert.pem</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Databases</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Create a database and user for a site</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:add --domainName=www.example.com --databaseName=shop_db --databaseUserName=shop_user --databaseUserPassword='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Export (backup) a database</span>, compressed because the name ends in .gz<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:export --databaseName=shop_db --file=shop_db.sql.gz</code></div></div><span style="font-weight: bold;" class="mycode_b">Import a database</span> (run it in the folder where the file is)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:import --databaseName=shop_db --file=shop_db.sql.gz</code></div></div><span style="font-weight: bold;" class="mycode_b">Show the MySQL master (root) login</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl db:show:master-credentials</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Protect the CloudPanel login</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Add an extra browser password in front of the panel</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudpanel:enable:basic-auth --userName=john.doe --password='YOUR-STRONG-PASSWORD'</code></div></div><span style="font-weight: bold;" class="mycode_b">Remove it again</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudpanel:disable:basic-auth</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Cloudflare</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Refresh Cloudflare's IP list</span> (CloudPanel already does this daily; useful after you start using "Cloudflare only")<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudflare:update:ips</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Panel users</span></span><br />
<span style="font-weight: bold;" class="mycode_b">Add an admin user</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:add --userName='jane' --email='jane@example.com' --firstName='Jane' --lastName='Doe' --password='YOUR-STRONG-PASSWORD' --role='admin' --timezone='UTC' --status='1'</code></div></div><span style="font-weight: bold;" class="mycode_b">Add a user who can only see certain sites</span> (great for clients)<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:add --userName='client1' --email='client@example.com' --firstName='Client' --lastName='One' --password='YOUR-STRONG-PASSWORD' --role='user' --sites='example.com' --timezone='UTC' --status='1'</code></div></div><span style="font-weight: bold;" class="mycode_b">Delete a user</span><br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:delete --userName='client1'</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Safety tips</span></span><ul class="mycode_list"><li>Put passwords in single quotes, especially if they contain <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div>, so the shell doesn't change them.<br />
</li>
<li>Commands with a password stay in your shell history. Clear it afterwards with <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>history -c</code></div></div> if other people use the server.<br />
</li>
<li>Always export a database before you import over it or delete a site.<br />
</li>
</ul>
<br />
<span style="font-size: small;" class="mycode_size">Sources (checked October 2026): <a href="https://www.cloudpanel.io/docs/v2/cloudpanel-cli/root-user-commands/" target="_blank" rel="noopener" class="mycode_url">CloudPanel CLI: root user commands</a> · <a href="https://www.cloudpanel.io/blog/cloudpanel-cli-interface/" target="_blank" rel="noopener" class="mycode_url">CloudPanel CLI interface</a></span><br />
<br />
New to clpctl? Start here: <a href="https://adminsforum.com/Thread-guide-cloudpanel-getting-started-with-the-clpctl-command" target="_blank" rel="noopener" class="mycode_url">Getting started with the clpctl command</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[CloudPanel: getting started with the clpctl command]]></title>
			<link>https://adminsforum.com/Thread-guide-cloudpanel-getting-started-with-the-clpctl-command</link>
			<pubDate>Wed, 07 Oct 2026 10:03:57 +0800</pubDate>
			<dc:creator><![CDATA[<a href="https://adminsforum.com/member.php?action=profile&uid=1">JAY</a>]]></dc:creator>
			<guid isPermaLink="false">https://adminsforum.com/Thread-guide-cloudpanel-getting-started-with-the-clpctl-command</guid>
			<description><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">CloudPanel: getting started with the clpctl command</span></span><br />
<br />
CloudPanel comes with <span style="font-weight: bold;" class="mycode_b">clpctl</span>, a command-line tool for jobs you'd otherwise click through in the browser. You don't need it for everyday work, but it's the tool that saves you when the web interface is out of reach, and it makes repeat jobs fast and identical every time. This guide explains how clpctl is organised, how to explore it safely and which commands are worth knowing first. For a full list, keep the <a href="https://adminsforum.com/Thread-guide-clpctl-cheat-sheet-useful-cloudpanel-commands-for-everyday-admin" target="_blank" rel="noopener" class="mycode_url">clpctl cheat sheet</a> open.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Two kinds of commands: root and site user</span></span><br />
clpctl has two groups of commands, and which user you are decides which ones work:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Root user commands</span> manage the whole server: sites, panel users, databases, certificates, vhost templates and panel security. Log in over SSH as <span style="font-weight: bold;" class="mycode_b">root</span> for these.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Site user commands</span> work inside one site: resetting file permissions, exporting and importing that site's databases, and purging its Varnish cache. Log in as the <span style="font-weight: bold;" class="mycode_b">site user</span>, or switch from root with <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser</code></div></div>.<br />
</li>
</ul>
Using the wrong user is the most common reason a command "doesn't work". More on that in <a href="https://adminsforum.com/Thread-guide-clpctl-errors-in-cloudpanel-command-not-found-wrong-user-and-quoting-fixes" target="_blank" rel="noopener" class="mycode_url">clpctl errors: command not found, wrong user and quoting</a>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Explore without changing anything</span></span><br />
List every command available to the current user:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl list</code></div></div>Show the options of one command before you run it:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:php --help</code></div></div>Commands are named <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>area:action</code></div></div> (for example <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:export</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>lets-encrypt:install:certificate</code></div></div>), and options use camelCase: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--domainName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--databaseName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--userName</code></div></div>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Safe commands to try first</span></span><br />
These only read information, so they're a good way to get comfortable. As root:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:list
clpctl vhost-templates:list
clpctl db:show:master-credentials</code></div></div>The last one prints the database master login. Treat its output like a password: don't paste it into tickets or forum posts.<br />
<br />
As a site user, inside the site folder, a harmless one is purging the site's cache:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl varnish-cache:purge --purge=all</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Commands worth knowing for emergencies</span></span><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Lost the panel password:</span> <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:reset:password --userName='john.doe' --password='New-Strong-Pass'</code></div></div></li>
<li><span style="font-weight: bold;" class="mycode_b">Lost your 2FA device:</span> <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:disable:mfa --userName='john.doe'</code></div></div></li>
<li><span style="font-weight: bold;" class="mycode_b">Locked out by panel Basic Auth:</span> <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudpanel:disable:basic-auth</code></div></div></li>
<li><span style="font-weight: bold;" class="mycode_b">Messed-up file permissions</span> (as the site user, in the site folder): <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl system:permissions:reset --directories=770 --files=660 --path=.</code></div></div></li>
</ul>
Step-by-step help for lockouts: <a href="https://adminsforum.com/Thread-guide-can-t-log-in-to-cloudpanel-port-8443-lost-password-and-2fa-fixes" target="_blank" rel="noopener" class="mycode_url">Can't log in to CloudPanel?</a><br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Good habits</span></span><ul class="mycode_list"><li>Put option values in <span style="font-weight: bold;" class="mycode_b">single quotes</span>, especially passwords with <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div> in them.<br />
</li>
<li>Take a snapshot or backup before commands that change or delete things (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>site:delete</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:import</code></div></div>).<br />
</li>
<li>Try new commands on a test site first.<br />
</li>
<li>When you script clpctl, log the output so you can see failures later.<br />
</li>
</ul>
<br />
<span style="font-size: small;" class="mycode_size">Sources: <a href="https://cloudpanel.io/docs/v2/cloudpanel-cli/root-user-commands" target="_blank" rel="noopener" class="mycode_url">CloudPanel: root user commands</a> · <a href="https://www.cloudpanel.io/docs/v2/cloudpanel-cli/site-user-commands/" target="_blank" rel="noopener" class="mycode_url">CloudPanel: site user commands</a></span>]]></description>
			<content:encoded><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">CloudPanel: getting started with the clpctl command</span></span><br />
<br />
CloudPanel comes with <span style="font-weight: bold;" class="mycode_b">clpctl</span>, a command-line tool for jobs you'd otherwise click through in the browser. You don't need it for everyday work, but it's the tool that saves you when the web interface is out of reach, and it makes repeat jobs fast and identical every time. This guide explains how clpctl is organised, how to explore it safely and which commands are worth knowing first. For a full list, keep the <a href="https://adminsforum.com/Thread-guide-clpctl-cheat-sheet-useful-cloudpanel-commands-for-everyday-admin" target="_blank" rel="noopener" class="mycode_url">clpctl cheat sheet</a> open.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Two kinds of commands: root and site user</span></span><br />
clpctl has two groups of commands, and which user you are decides which ones work:<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Root user commands</span> manage the whole server: sites, panel users, databases, certificates, vhost templates and panel security. Log in over SSH as <span style="font-weight: bold;" class="mycode_b">root</span> for these.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Site user commands</span> work inside one site: resetting file permissions, exporting and importing that site's databases, and purging its Varnish cache. Log in as the <span style="font-weight: bold;" class="mycode_b">site user</span>, or switch from root with <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>su - siteuser</code></div></div>.<br />
</li>
</ul>
Using the wrong user is the most common reason a command "doesn't work". More on that in <a href="https://adminsforum.com/Thread-guide-clpctl-errors-in-cloudpanel-command-not-found-wrong-user-and-quoting-fixes" target="_blank" rel="noopener" class="mycode_url">clpctl errors: command not found, wrong user and quoting</a>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Explore without changing anything</span></span><br />
List every command available to the current user:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl list</code></div></div>Show the options of one command before you run it:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl site:add:php --help</code></div></div>Commands are named <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>area:action</code></div></div> (for example <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:export</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>lets-encrypt:install:certificate</code></div></div>), and options use camelCase: <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--domainName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--databaseName</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>--userName</code></div></div>.<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Safe commands to try first</span></span><br />
These only read information, so they're a good way to get comfortable. As root:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:list
clpctl vhost-templates:list
clpctl db:show:master-credentials</code></div></div>The last one prints the database master login. Treat its output like a password: don't paste it into tickets or forum posts.<br />
<br />
As a site user, inside the site folder, a harmless one is purging the site's cache:<br />
<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl varnish-cache:purge --purge=all</code></div></div><br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Commands worth knowing for emergencies</span></span><ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Lost the panel password:</span> <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:reset:password --userName='john.doe' --password='New-Strong-Pass'</code></div></div></li>
<li><span style="font-weight: bold;" class="mycode_b">Lost your 2FA device:</span> <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl user:disable:mfa --userName='john.doe'</code></div></div></li>
<li><span style="font-weight: bold;" class="mycode_b">Locked out by panel Basic Auth:</span> <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl cloudpanel:disable:basic-auth</code></div></div></li>
<li><span style="font-weight: bold;" class="mycode_b">Messed-up file permissions</span> (as the site user, in the site folder): <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>clpctl system:permissions:reset --directories=770 --files=660 --path=.</code></div></div></li>
</ul>
Step-by-step help for lockouts: <a href="https://adminsforum.com/Thread-guide-can-t-log-in-to-cloudpanel-port-8443-lost-password-and-2fa-fixes" target="_blank" rel="noopener" class="mycode_url">Can't log in to CloudPanel?</a><br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Good habits</span></span><ul class="mycode_list"><li>Put option values in <span style="font-weight: bold;" class="mycode_b">single quotes</span>, especially passwords with <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>!</code></div></div> or <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>&#36;</code></div></div> in them.<br />
</li>
<li>Take a snapshot or backup before commands that change or delete things (<div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>site:delete</code></div></div>, <div class="codeblock"><div class="title af-code-title"><span>Code:</span><button type="button" class="af-code-copy" aria-label="Copy code" title="Copy code"><i class="far fa-copy" aria-hidden="true"></i><span>Copy</span></button><span class="af-code-status" role="status" aria-live="polite"></span></div><div class="body" dir="ltr"><code>db:import</code></div></div>).<br />
</li>
<li>Try new commands on a test site first.<br />
</li>
<li>When you script clpctl, log the output so you can see failures later.<br />
</li>
</ul>
<br />
<span style="font-size: small;" class="mycode_size">Sources: <a href="https://cloudpanel.io/docs/v2/cloudpanel-cli/root-user-commands" target="_blank" rel="noopener" class="mycode_url">CloudPanel: root user commands</a> · <a href="https://www.cloudpanel.io/docs/v2/cloudpanel-cli/site-user-commands/" target="_blank" rel="noopener" class="mycode_url">CloudPanel: site user commands</a></span>]]></content:encoded>
		</item>
	</channel>
</rss>