Self-hosting
Shared hosting (cPanel)
- Self-hosted only
You can run Leantime on most shared hosting plans that come with cPanel, like those from Hostinger, GoDaddy or Bluehost. You don’t need a command line: everything below happens in cPanel and its File Manager.
This page is for hosting Leantime yourself. With Leantime Cloud, there’s nothing to install.
Before you start, check with your host that the plan has:
- PHP 8.2 or later, with the extensions on System requirements
- MySQL 8.0+ or MariaDB 10.6+
- A domain or subdomain you can point at a folder of your choice
- Cron jobs, for notification emails and Leantime’s daily jobs
Step 1: Check PHP
Section titled “Step 1: Check PHP”- In cPanel, open Select PHP Version (or MultiPHP Manager, depending on your host).
- Choose PHP 8.2 or later.
- On the same page, check that the extensions on System requirements are ticked.
Step 2: Create the database
Section titled “Step 2: Create the database”- Open MySQL Databases (or MySQL Database Wizard).
- Create a database, for example
leantime. - Create a user with a strong password. Use the password generator.
- Add the user to the database with ALL PRIVILEGES.
Write down the database name, the user name and the password. cPanel puts your account name in front of both names, for example myaccount_leantime: use the full names in step 5.
Step 3: Upload Leantime
Section titled “Step 3: Upload Leantime”- Download the
.zipfile of the latest release to your computer, for exampleLeantime-v3.15.3.zip. - In cPanel, open File Manager and go to your home folder: the one that holds
public_html, notpublic_htmlitself. - Create a folder called
leantime, open it, and Upload the zip file. - Extract the zip in that folder, then delete the zip.
Leantime’s folder has a public folder inside it. Only public should be reachable from the web: your settings and uploaded files stay outside it. That’s why Leantime doesn’t go into public_html.
Step 4: Point a domain at Leantime
Section titled “Step 4: Point a domain at Leantime”- Open Domains (or Subdomains on older cPanel versions) and create a subdomain of your own website, for example
projects.example.com. - Set its document root to
leantime/public.
If your host won’t let you choose the document root, ask their support to point your new subdomain at the leantime/public folder in your hosting account. A subfolder install is the other option, but it needs changes to the web server’s settings that only your host can make. Don’t move the whole leantime folder into public_html to get around this: your settings and uploaded files would be reachable from the web.
Step 5: Add your settings
Section titled “Step 5: Add your settings”- In File Manager, open
leantime/config. Switch on Show Hidden Files in File Manager’s Settings, so you can see files that start with a dot. - Copy
sample.envto a new file called.env, and open.envwith Edit. - Fill in these lines:
LEAN_APP_URL = 'https://projects.example.com'LEAN_DB_HOST = 'localhost'LEAN_DB_USER = 'myaccount_leantime'LEAN_DB_PASSWORD = 'the password from step 2'LEAN_DB_DATABASE = 'myaccount_leantime'LEAN_SESSION_PASSWORD = 'a long random string'- Optional: set
LEAN_DEFAULT_TIMEZONE, like'Europe/Berlin', andLEAN_LANGUAGE. - Save the file.
All settings are explained on Configuration.
Step 6: Run the installer
Section titled “Step 6: Run the installer”- Open
https://projects.example.com/installin your browser. - Fill in your company name and your admin account, and click Install.
- Sign in, and Leantime walks you through your first project.
Step 7: Set up the cron job
Section titled “Step 7: Set up the cron job”Leantime needs a cron job to send notification emails and run its daily jobs (see Scheduled jobs, the queue and Redis).
- In cPanel, open Cron Jobs.
- Choose Once Per Five Minutes.
- Enter this command, with your cPanel user name in the path:
cd /home/YOUR_CPANEL_USER/leantime && php ./bin/leantime schedule:run >/dev/null 2>&1If the cron job’s php is older than 8.2, ask your host for the path to PHP 8.2 for cron jobs and use that instead of php. If your plan has no cron jobs, call https://projects.example.com/cron/run from an external scheduler instead (see How do I run the scheduled jobs?).
Step 8: Set up email
Section titled “Step 8: Set up email”Leantime sends invitations and notifications by email, so set this up before you invite your team. Many shared hosts limit outgoing email; see Email configuration for what works.
What if something goes wrong?
Section titled “What if something goes wrong?”- A blank page, or “page not found” on everything but the start page: the
public/.htaccessfile is missing, or Apache’s rewrite module is off. Check that.htaccessis inleantime/public(with hidden files shown). Some hosts also needRewriteBase /in it (see Common issues). - Errors about PHP or extensions: the website runs a different PHP version than you set, or an extension is missing. Check Select PHP Version again.
- It can’t connect to the database: check the full names with your account prefix. If
localhostdoesn’t work, try127.0.0.1. - Uploads or logins fail: Leantime must be able to write to
storage/,bootstrap/cache/,userfiles/andpublic/userfiles/. Folders set to755usually work on cPanel. - Anything else: look in
leantime/storage/logs/for the error, and see Common issues. When you ask for help in the community chat, include the log lines.
How do I update Leantime later?
Section titled “How do I update Leantime later?”See the Upgrade guide. Back up your database and the leantime folder first (see Backup & Restore, which has steps for cPanel).
Related
Section titled “Related”- System requirements
- Package based installation: the same steps on your own server
- Plugins
Was this page helpful?
Thanks, glad it helped.
Thanks for telling us. What was missing?
