Self-hosting
Upgrade Leantime
- Self-hosted only
- Checked with Leantime 3.17
At a glance
You need
- A fresh backup of your database and files (see Backup and restore)
- The version you run now (help menu → System)
Where you'll work
- A terminal on your server (on shared hosting: your control panel's File Manager or FTP)
- Leantime in your browser, to run the database update
At the end
Leantime on the new version, with your data, files and plugins.
This guide is for self-hosted Leantime. Leantime Cloud is upgraded for you.
An upgrade has two parts. First you replace Leantime’s files with the new version: a new Docker image, the command line updater, or a release package. Then Leantime updates your database. Your projects, files, settings and plugins stay.
What should I do before I upgrade?
Section titled “What should I do before I upgrade?”- Back up your database and files. Follow Backup and restore. Some database changes can’t be undone, so a backup is the only way back.
- Find the version you run now. In Leantime, open the help menu (the question mark icon at the top right). The version is under System, for example Leantime V3.12.0.
- Read the notes for every version between yours and the new one. Start with What changed between versions? below, then the release notes.
- Check your plugins. Leantime skips a plugin that says it doesn’t support the new version. The plugin shows Not compatible in My Apps until you update it. Update Leantime first, then update the plugins. Two kinds of plugin aren’t checked, so check them yourself before you upgrade:
- plugins you turn on with
LEAN_PLUGINSin your configuration - plugins that don’t say which versions they support. Leantime assumes they work with every 3.x version.
- plugins you turn on with
- Pick a quiet time. After an upgrade, people usually have to sign in again.
You don’t have to upgrade one version at a time. Leantime runs every database change between your version and the new one. Read the notes for all the versions you skip.
What happens during the database update?
Section titled “What happens during the database update?”Many new versions change the database: they add tables or columns, or move data into a new shape. Leantime does this in its database update, which runs after you replace the files.
- Until the update runs, Leantime shows the Update Database page instead of any other page, and scheduled jobs wait. Run the update straight after you replace the files.
- You start it with Update Now! in the browser, or
php bin/leantime db:migratein the terminal. Both do the same thing. - It can take a few minutes on a large database. Don’t stop it or close the server while it runs.
- It can’t be undone. To go back, you restore the backup you made before the upgrade.
- Versions without database changes skip this step: Leantime opens as usual. What changed between versions? says which versions have database changes.
How do I upgrade with Docker?
Section titled “How do I upgrade with Docker?”These steps are for the Docker Compose setup. Your data is in Docker volumes, so it stays when the container is replaced.
-
Go to the folder with your
docker-compose.ymland.envfiles. -
Choose the version. The image is
leantime/leantime:${LEAN_VERSION:-latest}:- To get a specific version, set it in
.env, for exampleLEAN_VERSION=3.17.0. - Without
LEAN_VERSION, Docker useslatest.
- To get a specific version, set it in
-
Download the new image and replace the container:
Terminal window docker compose pulldocker compose up -d -
Open Leantime in your browser. If the new version has database changes, you see Update Database. Select Update Now!

-
Sign in again.
You can also run the database update from the terminal instead of the browser:
docker compose exec leantime php bin/leantime db:migrateIf you started Leantime with docker run, stop and remove the container, then run the same docker run command with the new image tag. Keep the same volumes and environment settings.
Don’t use the command line updater (system:update) in Docker. When the container is replaced, the files from the image come back.
How do I upgrade with the command line updater?
Section titled “How do I upgrade with the command line updater?”On a server where you installed the release package, Leantime can upgrade itself. Run the updater as the user your web server runs as, so the new files have the right owner:
cd /var/www/leantimesudo -u www-data php bin/leantime system:updateThe updater:
- Checks GitHub for the latest version. It always installs the latest release; you can’t choose a version.
- Lists your enabled plugins that don’t support the new version, and asks if you want to continue.
- Backs up the database with
mysqldumpto the folder inLEAN_DB_BACKUP_PATH(backupdb/in the sample configuration). - Downloads the release, turns your plugins off and copies the new files over the old ones.
- Clears the caches and signs everyone out.
- Turns your plugins back on. A plugin that doesn’t support the new version stays off until you update it.
The updater doesn’t update the database. When it’s done, open Leantime and select Update Now!, or run:
sudo -u www-data php bin/leantime db:migrateThe updater needs the PHP zip extension. If the backup step shows an error, the updater continues without a backup, so make your own backup first.
How do I upgrade by hand?
Section titled “How do I upgrade by hand?”Use these steps if you can’t use Docker or the updater, for example on shared hosting.
-
Download
Leantime-vX.Y.Z.zipfor the new version from the releases page. -
Unzip it into a new, empty folder. The zip has no folder of its own, so name one:
Terminal window unzip Leantime-v3.17.0.zip -d /var/www/leantime-new -
Stop changes to your data while you copy it. Stop the web server, and pause the cron job that runs Leantime’s scheduled jobs. Otherwise a file someone uploads now stays behind in the old folder. On shared hosting, where you can’t stop the web server, upgrade when nobody is using Leantime.
-
Copy these from your current Leantime folder into the new one:
config/.env(orconfig/configuration.phpon old installs)userfiles/public/userfiles/app/Plugins/- your database backup folder, if it’s inside the Leantime folder (
backupdb/in the sample configuration)
-
If you changed
public/.htaccess, make the same change in the new version’s file. For example, some shared hosts needRewriteBase /(see Common issues). Don’t copy the old file over the new one: new versions can change its rules. -
Give the new folder to the web server user, and let it write to
storage/,userfiles/andpublic/userfiles/:Terminal window sudo chown -R www-data:www-data /var/www/leantime-new -
Swap the folders. Keep the old one until you know the upgrade worked:
Terminal window sudo mv /var/www/leantime /var/www/leantime-oldsudo mv /var/www/leantime-new /var/www/leantime -
Start the web server. Open Leantime and select Update Now!, or run
php bin/leantime db:migratein the Leantime folder. -
Turn the cron job back on.
On shared hosting, do the same with your control panel’s File Manager or FTP: upload the new files into a new folder, copy the items from step 4 into it, then rename the folders. See Shared hosting.
Installed from git? After you pull the new version, run composer install, because new versions can add dependencies.
What changed between versions?
Section titled “What changed between versions?”The notes below are the changes that affect an upgrade. Changes for plugin developers are in the release notes.
- The database changes. Open Leantime and click Update Now!, or run
php bin/leantime db:migrate. - Morning summaries start for everyone. Each person gets one message a day, at 08:00 in their time zone, when something they own is coming up: due to-dos, milestones ending and, for project managers, projects ending. People change the time or turn it off under My Profile → Notifications, and administrators can turn it off for everyone in Company Settings. It’s sent by Leantime’s scheduled jobs, so it needs the cron job on your own server.
- Calendar servers on your own network. Leantime only connects to public addresses. To let it reach a calendar server, iCal feed or webhook on your network, list it in
LEAN_OUTBOUND_ALLOWED_HOSTS, for example'nextcloud.lan,192.168.1.0/24'. - CalDAV Calendar Sync: update the plugin to 1.1.0. People who use two-factor authentication or single sign-on connect calendar apps with an app password.
- MCP Server: the reminder tools need plugin 2.1.0 or later.
- Access: to-dos can only be assigned to people who can see the project, and a changed role takes effect on the person’s next click instead of their next sign-in.
- The database changes. Open Leantime and click Update Now!, or run
php bin/leantime db:migrate. The command line updater doesn’t run this update. - AI assistants can sign in. Claude, ChatGPT and other apps connect to Leantime’s MCP server by signing in, with no API key. It’s on by default; set
LEAN_OAUTH_ENABLED=falseto switch it off (see MCP server). - Update Advanced Authentication to 1.5.0 if you use it. Then signing in with a provider also works when an AI assistant connects, and the mobile app can tell whether your server sends phone notifications.
- Phone notifications have a new setting in Company Settings: what they show on lock screens. It starts at Everything (see Notifications).
- 3.15.1: Users and API keys that aren’t active can’t sign in or use the API any more, even with an open session or an existing token. Deleting a client that has projects now also needs permission to delete projects.
- 3.15.2: LDAP and OpenID Connect sign-ins are refused for deactivated users and for people who haven’t accepted their invite yet, the same as a password sign-in.
- No database changes.
- Custom Fields versions before 1.6.0 don’t load. Update Custom Fields in My Apps.
- No database changes.
- Database update. Adds the per-project feature switches.
- 3.13.2: Database update.
- Leantime runs on Laravel 12. PHP 8.2 is still the minimum. The Docker images use PHP 8.4.
- MCP Server plugin: update to version 2.0. Version 1.x doesn’t run on 3.13.
- The 3.13 releases of Custom Fields, Notes, Programs (PgmPro), Strategy Pro (StrategyPro) and Whiteboards need Leantime 3.13. Update Leantime first, then the plugins.
- Database update. Merges duplicate plugin rows that older plugin updates left behind.
- Leantime checks which versions each plugin supports, and skips plugins that don’t support yours. It doesn’t check plugins set in
LEAN_PLUGINS, and it assumes plugins that don’t say which versions they support work with every 3.x version. - A plugin that causes 5 errors in 10 minutes is turned off, and admins get a notification. Its license stays active.
- Database update. On MySQL and MariaDB it builds the indexes for search. On a large database this takes about 30 seconds per million rows. Don’t stop it.
- 3.10.0: Database update.
- 3.10.1: Database update. The server always runs in UTC.
LEAN_DEFAULT_TIMEZONEis now only the default for users who haven’t chosen a timezone. Times saved before this release in another timezone aren’t converted and can show shifted. - 3.10.2 (security release): Everyone is signed out once, and password reset links sent before the upgrade stop working.
- Set
LEAN_APP_URLto your public address. If a reverse proxy changes the host name, forms are refused without it. - Leantime now only trusts proxies on private networks. If your proxy or CDN connects from a public address, add it to
LEAN_TRUSTED_PROXIES. - OpenID Connect sign-ins need a verified email address. For providers that don’t verify email, set
LEAN_OIDC_REQUIRE_VERIFIED_EMAIL=false.
- Set
- 3.10.3: Password reset and invite emails only use a trusted address. If
LEAN_APP_URLisn’t set, Leantime doesn’t send them until an owner or admin signs in. Plugin scheduled jobs (like Recurring Tasks and calendar sync) now run, so the first run after the upgrade can catch up on missed work.
- Database update (3.9.0 and 3.9.6).
- The text editor changed. Your content stays the same, but custom extensions for the old editor (TinyMCE) don’t work any more.
- Skip 3.6.0 and 3.6.1. Upgrade straight to 3.6.2 or later.
- PHP 8.2 or later is required.
- Turn off all plugins before you upgrade, and make sure
storage/framework/sessions/exists and the web server can write to it.
From 2.x to 3.x
Section titled “From 2.x to 3.x”- Turn off all plugins in 2.x first.
- Replace all files with the new version. Don’t merge old and new files.
- Leantime still reads
config/configuration.php, but new settings only exist inconfig/sample.env. Move your settings toconfig/.envwhen you can. - From 2.1 or older, you can also install the latest version fresh, import your database and copy
userfiles/across. The database update then runs all the changes in between.
What if something goes wrong?
Section titled “What if something goes wrong?”First, look at the log. It’s in storage/logs/ in the Leantime folder. In Docker, the logs volume holds it, or run docker compose logs leantime.
The Update Database page shows “There was a problem updating your database”. Run php bin/leantime db:migrate in the Leantime folder (in Docker: docker compose exec leantime php bin/leantime db:migrate). It shows the step that failed. In Docker, see also The update gets stuck on “Update Database”.
The database update stops at the email queue (zp_queue). From 3.10.1, Leantime rebuilds this table as InnoDB with ROW_FORMAT=DYNAMIC when it uses another engine (such as MyISAM) or an older InnoDB row format (COMPACT or REDUNDANT). If the rebuild fails, the update stops and your database stays on the old version. The log shows the error, starting with Migration 30527. Make sure your MySQL or MariaDB server can create InnoDB tables with ROW_FORMAT=DYNAMIC, then run php bin/leantime db:migrate again.
A plugin shows Not compatible. Update it in My Apps. Leantime skipped it, so it doesn’t stop the rest of Leantime.
Pages show an error 500. Check the log, then clear the caches:
php bin/leantime cache:clearAllOn package installs, also check that the server runs PHP 8.2 or later.
Forms are refused or you can’t sign in after 3.10.2. Set LEAN_APP_URL to the address people use to open Leantime, including https://.
Still stuck? Ask the Leantime community on Discord. The Leantime team also offers paid services, such as installation and managed hosting.
How do I go back to the old version?
Section titled “How do I go back to the old version?”- Stop Leantime, so nobody changes data while you restore it.
- Docker:
docker compose stop leantime. The database container keeps running. - Server: stop the web server and pause the cron job.
- Docker:
- Put the old files back.
- Docker: set
LEAN_VERSIONin.envto your old version. Don’t start the container yet. - By hand: move the old folder (
leantime-old) back into place. - Updater: the updater copies the new files over the old ones, so there’s no old folder. Download the zip of your old version from the releases page. Then follow steps 2 and 4 to 7 of How do I upgrade by hand?: unzip it into a new folder, copy your configuration, files and plugins into it, and swap the folders.
- Docker: set
- Restore the database backup you made before the upgrade. The old version can’t use a database that the new version changed. See Backup and restore.
- Start Leantime again.
- Docker:
docker compose up -d. - Server: start the web server and turn the cron job back on.
- Docker:
Related
Section titled “Related”Was this page helpful?
Thanks, glad it helped.
Thanks for telling us. What was missing?
