Skip to main content

Docker

Docker is an open source containerization platform. It enables developers to package applications into standardized executable components called containers. These containers combine the application's source code with the Operating System (OS) libraries and dependencies required to run that code in any environment.

Prerequisites

  1. Create an installation folder called appsmith for deployment and data storage.
  2. cd into the installation folder.

The Appsmith Docker image contains all the components required to run, within a single Docker container. All these multiple processes are managed by a Supervisord instance, which is a lightweight process manager.

  1. Click to download the docker-compose.yml file, and place it into the Appsmith installation folder.

    OR, run the following cURL:

    curl -L https://bit.ly/3h08WqB -o $PWD/docker-compose.yml
  2. Start the Docker container by running the command below. This may need to be run with sudo if docker and docker-compose aren't accessible by the user. If the image doesn't exist locally, this command downloads the necessary Docker image and starts the container.

    docker-compose up -d

The Appsmith server should be up and running soon, and it can be accessed at http://localhost. Check the Docker logs to verify that the instance is working correctly.

Updating Appsmith

To update Appsmith manually, go to the root directory of the installation and run the following command:

docker-compose pull && docker-compose rm -fsv appsmith && docker-compose up -d

Enabling Appsmith auto-updates

Automatic updates are turned off by default in the docker-compose.yml file. To enable them, please follow these steps:

  1. Go to the root directory of the Appsmith installation and run:

    docker-compose down
  2. Open the docker-compose.yml file with any text editor and un-comment lines 13-23.

  3. Save the file and run:

    docker-compose up -d
info

To complement automatic updates, Appsmith also has an auto-backup feature. Before an automatic update, Appsmith first creates a backup to allow rolling back an update to a previous version of Appsmith if necessary. For this auto-backup to work, please ensure that there is a minimum of 2 GB of free storage; otherwise, both the backup and update tasks fail.

This configuration runs an Appsmith instance and a Watchtower instance to keep Appsmith automatically up-to-date. The installation is now configured to stay up-to-date automatically.


Setup with Docker run

This command downloads the image and starts Appsmith:

docker run -d --name appsmith -p 80:80 -v "$PWD/stacks:/appsmith-stacks" --pull always appsmith/appsmith-ce

Updating Appsmith

To update Appsmith manually, go to the root directory of the installation and run the following commands:

docker rmi appsmith/appsmith-ce -f
docker pull appsmith/appsmith-ce
docker rm -f appsmith
docker run -d --name appsmith -p 80:80 -v "$PWD/stacks:/appsmith-stacks" appsmith/appsmith-ce

Once the download is complete, the server should be up soon. You can verify that it's working correctly in the Docker logs.

Docker logs

Once the Appsmith container is ready, the message Appsmith is Running! will be displayed in the Docker logs.

Appsmith is running message

You can follow the logs with the following command:

docker logs -f appsmith

This message is also logged and available in server logs in (stacks/logs/backend/backend.log).

Restarting containers

If the Docker containers are failing to restart, download and run the restart-container.sh script linked below to bring them up:

Copy the script (restart-container.sh) to the installation folder and make it executable:

chmod +x restart-container.sh
./restart-container.sh

Troubleshooting

If there are any errors during this process, follow the guide on debugging deployment errors. If there are still issues, please contact support@appsmith.com or join the Appsmith Discord Server to speak to the Appsmith team directly.

Further reading