docs/self-hosting/deployment-options/linux-upgrade.mdx
This guide explains how to upgrade Infisical Linux package installations to newer versions. The Infisical Linux package includes only the Infisical service component itself, as PostgreSQL and Redis databases are managed separately. Upgrades for PostgreSQL and Redis are not covered in this guide as they depend on your specific database deployment method.
There are two primary methods to upgrade Infisical:
Before upgrading, note your current Infisical version:
cat /opt/infisical-core/version-manifest.txt
Look for infisical component. This will be the version of Infisical currently installed.
We strongly recommend backing up your database before upgrading. Your backup approach may look different depending on how you configured PostgreSQL and whether it's self-managed or using a managed service. Here is a sample of how you would perform a manual backup:
# Example PostgreSQL backup command (adjust parameters as needed)
pg_dump -U <username> -h <db-host> -d <db-name> > infisical_backup.sql
By default, Infisical runs database migrations automatically on startup.
This method is suitable for single-node deployments or situations where a brief downtime is acceptable.
<Steps> <Step title="Stop the Infisical service"> ```bash infisical-ctl stop ``` </Step> <Step title="Upgrade the Infisical package"> To upgrade to the latest version: <Tabs> <Tab title="Debian/Ubuntu"> ```bash sudo apt-get update && sudo apt-get install -y infisical-core ``` </Tab> <Tab title="RHEL/CentOS/Amazon Linux"> ```bash sudo yum update infisical-core ``` </Tab> </Tabs>To upgrade to a specific version:
<Tabs> <Tab title="Debian/Ubuntu"> ```bash sudo apt-get install -y infisical-core=<version> ``` </Tab> <Tab title="RHEL/CentOS/Amazon Linux"> ```bash sudo yum install infisical-core-<version> ``` </Tab> </Tabs> </Step> <Step title="Apply configuration changes"> ```bash infisical-ctl reconfigure ``` </Step> <Step title="Start Infisical"> ```bash infisical-ctl start ``` </Step> <Step title="Verify the upgrade"> ```bash infisical-ctl status ```Check the logs for any issues:
infisical-ctl tail
For multi-node setups where you need to maintain availability during upgrades, follow this procedure. This approach requires at least two Infisical nodes behind a load balancer.
"Draining" a server means gracefully removing it from the pool of active servers without disrupting existing connections. When you drain a server:
This approach ensures users/machines do not experience sudden connection errors during the upgrade process.
Designate a deploy node: Choose any single node that will run migrations. This node will be upgraded first.
Configure your load balancer: Ensure your load balancer can perform health checks against Infisical's api/status endpoint.
Drain the traffic on this node gracefully. You can do this in a number of ways depending on the load balancer you have configured. Approaches for some common load balancers are provided below:
<Tabs> <Tab title="NGINX"> If using NGINX as a load balancer, you can remove the server from the upstream pool temporarily: ```bash # Edit your NGINX configuration to comment out or remove the server sudo nano /path/to/your/nginx-config.conf # Reload NGINX to apply changes
sudo nginx -s reload
```
To upgrade to the latest version:
<Tabs> <Tab title="Debian/Ubuntu"> ```bash sudo apt-get update && sudo apt-get install -y infisical-core ``` </Tab> <Tab title="RHEL/CentOS/Amazon Linux"> ```bash sudo yum update infisical-core ``` </Tab> </Tabs>To upgrade to a specific version:
<Tabs> <Tab title="Debian/Ubuntu"> ```bash sudo apt-get install -y infisical-core=<version> ``` </Tab> <Tab title="RHEL/CentOS/Amazon Linux"> ```bash sudo yum install infisical-core-<version> ``` </Tab> </Tabs> </Step> <Step title="Apply configuration and start the service"> ```bash infisical-ctl reconfigure ``` </Step> <Step title="Verify the upgrade and migration success"> ```bash infisical-ctl tail ``` Look for successful migration messages in the logs. </Step> <Step title="Return this node to load balancer pool"> Re-enable the server in your load balancer using the same method you used to remove it. </Step> </Steps>To upgrade to a specific version:
<Tabs> <Tab title="Debian/Ubuntu"> ```bash sudo apt-get install -y infisical-core=<version> ``` </Tab> <Tab title="RHEL/CentOS/Amazon Linux"> ```bash sudo yum install infisical-core-<version> ``` </Tab> </Tabs> </Step> <Step title="Apply configuration and start the service"> ```bash infisical-ctl reconfigure ``` </Step> <Step title="Verify the upgrade success"> ```bash infisical-ctl status infisical-ctl tail ``` </Step> <Step title="Wait for service to be fully operational"> - Check logs to ensure the service has started successfully - Verify it can connect to the database and Redis </Step> <Step title="Return the node to service"> Re-enable the server in your load balancer using the same method you used to remove it. </Step> <Step title="Verify traffic is flowing correctly"> Check logs and monitoring to ensure traffic is flowing correctly. </Step> <Step title="Repeat for each remaining node"> Repeat steps 1-7 for each remaining node, one at a time. </Step> <Step title="Verify application functionality"> After all nodes are upgraded, verify that the application is functioning correctly: - Test core functionality - Check logs for any errors </Step> </Steps>If you need to roll back to a previous version of Infisical, follow steps below.
<Steps> <Step title="Stop the Infisical service"> ```bash infisical-ctl stop ``` </Step> <Step title="Install the previous version"> For Debian/Ubuntu: ```bash sudo apt-get install -y infisical-core=<previous-version> ```For RHEL/CentOS/Amazon Linux:
sudo yum downgrade infisical-core-<previous-version>
Check the logs:
infisical-ctl tail
Ensure the database user has sufficient privileges to create/modify tables.
If migrations fail repeatedly, consider restoring from the backup you took prior to upgrading.
/etc/infisical/infisical.rb file.
</Accordion>