Updates
Keeping your Evolution API instance up to date is crucial for security, performance, and access to new features. The update method depends on how you initially installed the API. This guide covers the steps to update your Evolution API using Docker Compose and NPM.
Before updating Evolution, ensure that all integrated applications are working correctly with Evolution. Update at your own risk.
Updating with Docker
If you initially set up your Evolution API using Docker, follow these steps to update:
Updating with Docker CLI
If your Evolution API was initially installed using Docker Compose via the command line interface (CLI) and not through Portainer or any other container management tool, follow these steps to update it:
-
Navigate to the Docker Compose Directory: Open a terminal and go to the directory where your Docker Compose file (
docker-compose.yml
) is located. -
Pull the Latest Image: Update the Evolution API image to the latest version by running the following command:
- Stop and Restart the Containers: After pulling the latest image, stop the current containers and restart them. This can be done using the following command:
Updating with Portainer
If you are using Portainer for container management, follow these steps to update your Evolution API:
-
Access the Portainer Dashboard: Open your Portainer dashboard in a web browser.
-
Navigate to Your Containers: Go to the ‘Stacks’ section where your Evolution API container is listed.
-
Update the Compose File:
- Locate the
image
field in your Docker Compose configuration.
- Locate the
- Update the value to
atendai/evolution-api:latest
for the latest version, or useatendai/evolutionapi:v1.x.x
for a specific version. - After making the changes, click the ‘Deploy’ button at the bottom of the compose editing window.
- Verify the Update: After recreating the container, verify that the Evolution API is running on the latest version. This can usually be checked via the API version endpoint or logs.
For production environments, it is advisable to specify a specific version of the Evolution API (e.g., atendai/evolution-api:v1.x.x) instead of using latest. This practice ensures stability and predictability, protecting your production environment from potential issues caused by unexpected changes in the latest version.
Updating with NPM
Updating your Evolution API installation via NPM involves several steps to ensure a smooth transition to the new version. Here is a step-by-step guide:
- Clean and Stop: Clean all PM2 logs, useful for troubleshooting after the update, and temporarily stop the Evolution API to apply updates safely.
- Reset the Local Repository and Pull the Latest Updates: Ensure your local codebase is synchronized with the latest commit and pull the latest updates from the repository. Optionally, switch to a specific version if not using the latest. This is recommended for production environments.
- Clean Installation: Remove the current
node_modules
directory to avoid potential conflicts with new dependencies and install the required Node.js dependencies for the updated version.