This guide sets Lou up on cPanel shared hosting with Git Version Control, using SSH or the cPanel Terminal.
No Git or SSH? Install from the release zip instead, with the web installer: see install.md. It works on any cPanel account, including the main domain's fixed public_html.
How it fits together
- Git deploys code only. php lou deploy copies the code folders into ~/lou. It creates site/ from the repository only on the first deploy. After that, the site belongs to the editor, the assistants and History, so a deploy never overwrites it. var/ and .env.php are never touched.
- Every build is atomic. The new site is rendered next to public/ and swapped in by renaming, so visitors never see a half-built site. The previous build goes to var/builds/ for rollback.
- Git commit on publish stays off (~/lou isn't a Git checkout).
1. PHP
- MultiPHP Manager: set the domain to PHP 8.3 (ea-php83) or newer.
- Extensions: you need pdo_sqlite, gd (with WebP), curl, mbstring, zip, dom and openssl. sodium (for checking updates), intl and exif are recommended. On EasyApache they're usually already on. On CloudLinux, enable them under Select PHP Version.
On the command line, php is often an older system PHP, so always use the full path. To save typing, add an alias:
echo "alias php='/opt/cpanel/ea-php83/root/usr/bin/php'" >> ~/.bashrc && source ~/.bashrc php -vOn CloudLinux the path is /opt/alt/php83/usr/bin/php. Cron jobs don't read ~/.bashrc, so use the full path there.
2. Clone the repository
The Lou repository is public, so cPanel can clone it over HTTPS without a key. In cPanel, open Git Version Control → Create:
- Clone URL: https://github.com/CloudFort-xyz/Lou.git
- Repository path: repositories/lou. Don't use lou or anything inside public_html.
- Repository name: Lou
To deploy a branch other than main, check it out under Manage → Basic Information → Checked-Out Branch.
Cloning a private repository (your own fork, or a client site repository, see below) needs a read-only deploy key:
ssh-keygen -t ed25519 -f ~/.ssh/lou_deploy -N "" -C "cpanel deploy" cat >> ~/.ssh/config <<'EOF' Host github.com IdentityFile ~/.ssh/lou_deploy IdentitiesOnly yes EOF chmod 600 ~/.ssh/config cat ~/.ssh/lou_deploy.pubOn GitHub, open that repository's Settings → Deploy keys → Add deploy key, paste the public key and leave write access off. Run ssh -T git@github.com once to accept GitHub's host key, then clone with the git@github.com:… address.
Installing somewhere else, or several sites
Some hosts give each domain its own folder, for example ~/domains/lou.example.com/ with the document root at public/ inside it. That folder can be the install, as long as the clone stays elsewhere. List install folders in ~/.lou-target, one per line:
echo ~/domains/lou.example.com >> ~/.lou-target echo ~/domains/example.org >> ~/.lou-targetA deploy without a folder argument (which is what .cpanel.yml runs) installs into every folder listed, or into ~/lou when the file is missing. Every site runs the same Lou code, and each keeps its own site/, var/ and .env.php. If one site fails, the others still deploy, and the output names the one that failed. To add a site, create its domain with the document root <folder>/public, add the folder to the file, and deploy. The first deploy seeds the new site.
All sites listed move to a new Lou version together. If a site needs to stay on an older version, give it its own clone on a branch and run php lou deploy <folder> from that clone.
Everywhere this guide says ~/lou, read your folder instead.
A client site in its own repository
A client's site can live in its own repository, with Lou pinned as a Git submodule:
example.com-site/ lou/ submodule → CloudFort-xyz/Lou at a pinned commit site/ the client's config, content, templates and assets .cpanel.ymlcPanel clones without submodules, so run git submodule update --init once in the clone (or clone with git clone --recurse-submodules over SSH). Deploy with --site so the first deploy seeds the install from the client's site/ rather than Lou's example site:
php ~/repositories/example.com-site/lou/lou deploy ~/domains/example.com --site=$HOME/repositories/example.com-site/siteIn this mode, later deploys also bring the server's site/templates/ and site/assets/ up to date with the repository, file by file: new and changed files are written, and files removed from the repository are removed. A file that was changed on the server since the last deploy (by an assistant, for example) is never overwritten. The deploy skips it and prints a warning until you commit the server's version to the repository (or delete the file on the server). site/assets/uploads/ (editor images), content, menus, config, var/ and .env.php always stay the server's. var/deploy-design.json records what the last deploy wrote.
For automatic deploys, add --pull to the same command in cron. With --site, it pulls the client repository (not Lou), checks out the Lou commit it pins, then deploys with that code. Moving the client to a newer Lou is a commit in the client repository that bumps the submodule.
3. First deploy
In Git Version Control → Manage → Pull or Deploy, click Deploy HEAD Commit. You can also run it yourself:
cd ~/repositories/lou && php lou deploy ~/louThis creates ~/lou, seeds site/ and builds ~/lou/public. It prints a short check. Warnings at this point are expected (base_url, .env.php, mail).
4. Point the domain at public/
Domains (or Addon Domains on older cPanel): set the addon domain's document root to lou/public. If you create the domain after the first deploy, enter lou/public when you create it.
Nothing else under ~/lou is reachable from the web.
Main domain instead? Its document root is fixed to public_html, so replace that with a symlink once ~/lou/public exists: mv ~/public_html ~/public_html.old && ln -s ~/lou/public ~/public_html. The atomic swap renames the folder behind the symlink, so the link keeps working. Don't do it the other way round, with output_dir pointing at a symlink.
Turn on HTTPS with SSL/TLS Status → Run AutoSSL.
5. Configure
Then open https://example.com/_lou/admin.php (or the secret address php lou admin-url prints, see below) and set the site address under Settings → General. It's used for the sitemap, language links, preview links and the bridge URL. Until you set it, the admin shows a red banner, and php lou check reports it as FAIL. The same page can rename the admin folder (_lou) to something less obvious, and Settings → Security → Admin address moves the login page to a secret address (php lou admin-url --new does the same from SSH).
Under Settings → Email, choose Send with SMTP and enter the sender address and the SMTP login (cPanel → Email Accounts → Connect Devices shows the server, port and user). Then use Send test email. Until SMTP is set up, form emails only go to var/mail.log.
6. Cron jobs
In Cron Jobs, use the full PHP path:
# hourly: re-send form emails/newsletter sign-ups that failed (e.g. SMTP was down) 0 * * * * /opt/cpanel/ea-php83/root/usr/bin/php ~/lou/lou retry >/dev/null # nightly: single-file backup of site/ + database, keep 14 30 3 * * * /opt/cpanel/ea-php83/root/usr/bin/php ~/lou/lou backup --keep=14 >/dev/nullCopy backups off the server from time to time. Admin → Backups can download them.
Updating Lou
Merge to the checked-out branch on GitHub (or wait for a release), then in cPanel open Git Version Control → Manage → Pull or Deploy. Click Update from Remote, reload the page, then click Deploy HEAD Commit. The code is replaced and the sites are rebuilt. Content isn't touched.
Automatic deploys (optional)
cPanel doesn't notice pushes to GitHub. To have merges go live by themselves, add a cron job that checks every 5 minutes:
*/5 * * * * /opt/cpanel/ea-php83/root/usr/bin/php ~/repositories/lou/lou deploy --pull >> ~/lou-deploy.log 2>&1--pull runs git fetch in the clone and exits silently when the branch has nothing new. When there are new commits, it fast-forwards, then deploys to every folder in ~/.lou-target using the new code. A lock stops two runs from overlapping. It never runs git reset, so if the clone ever has local changes, the fast-forward fails and the error goes to the log. Deploying by hand from cPanel keeps working alongside it.
Moving a site you built locally onto the server
Since site/ on the server is the truth, a deploy won't push template or content changes into it. To replace the server's site with one you built locally:
php lou backup --out=client.zip # locally # upload client.zip, then on the server: php lou restore client.zip --no-db # the server's current state is backed up firstFor layout changes after launch, use an assistant through the bridge, or the admin. Then publish.
Troubleshooting
- Deploy HEAD Commit is greyed out: .cpanel.yml must be in the checked-out branch, and the clone must have no local changes. Never edit files in ~/repositories/lou.
- What did the deploy do? cPanel writes a log per deploy to ~/.cpanel/logs/ (vc_*_git_deploy.log).
- "No PHP 8.3+ binary found": run ls /opt/cpanel/ /opt/alt/ to find your host's PHP path, then edit the list in .cpanel.yml.
- Admin works on the CLI but not in the browser: the domain's PHP (MultiPHP Manager) is a different version, or it's missing an extension. Set it to the same version that php lou check used.
- 500 error on every page: the host doesn't allow a directive in public/.htaccess, usually Options. Remove it from stubs/.htaccess and redeploy. The error log is at ~/logs/ or under Metrics → Errors.
- Rollback: Admin → History → Undo a publish, or restore a backup.
This page is generated from docs/deploy-cpanel.md in the Lou repository, so fixes go there. View the source on GitHub