Skip to content

Commit 55ffb9b

Browse files
authored
Document update process for Docker deployments
Add a section that describes on how to update Elasticsearch when running on Docker
1 parent 9db1778 commit 55ffb9b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

docs/reference/setup/install/docker.asciidoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,3 +764,47 @@ To resolve this error:
764764
path rather than the keystore file's path. For an example, see
765765
<<docker-keystore-bind-mount>>.
766766
. Retry the command.
767+
768+
==== Updating or Upgrading the Elasticsearch version running on Docker
769+
Updating Elasticsearch running in a Docker container involves pulling the new Docker image and restarting the container with the new image.
770+
771+
1. Pull the new version of the Elasticsearch Docker image from Elastic's Docker registry using the `docker pull` command. Replace `x.y.z` with the version number you want to update to.
772+
----
773+
docker pull docker.elastic.co/elasticsearch/elasticsearch:x.y.z
774+
----
775+
776+
2. Stop the currently running Elasticsearch container. Replace `container_name` with the name or ID of your Elasticsearch container.
777+
----
778+
docker stop container_name
779+
----
780+
781+
3. Once the container has stopped, remove it. This will not delete your data if you have correctly mapped your data directory to a volume outside of the container.
782+
----
783+
docker rm container_name
784+
----
785+
786+
4. Start a new container using the new image. Make sure to use the same volume mappings and configuration settings as the old container to ensure that your data and configuration are preserved. Replace `container_name` with the name you want for your new container.
787+
----
788+
docker run --name container_name -p 9200:9200 -p 9300:9300 \
789+
-e "discovery.type=single-node" \
790+
-v path_to_data_volume:/usr/share/elasticsearch/data \
791+
-v path_to_config_volume:/usr/share/elasticsearch/config \
792+
docker.elastic.co/elasticsearch/elasticsearch:x.y.z
793+
----
794+
795+
Adjust the `-p` flags for port mappings, `-e` for environment variables, and `-v` for volume mappings as needed based on your setup.
796+
797+
5. After the new container starts, verify that Elasticsearch is running the new version by querying the root URL of your Elasticsearch instance.
798+
----
799+
curl http://localhost:9200
800+
docker.elastic.co/elasticsearch/elasticsearch:x.y.z
801+
----
802+
803+
The response should show the version number of Elasticsearch that you updated to.
804+
805+
**Important Notes**:
806+
- Always back up your data before performing an update, especially for production environments.
807+
- Review the Elasticsearch release notes for the new version to be aware of any breaking changes or required actions before or after the update.
808+
- If you're using custom plugins or configurations, ensure they are compatible with the new version and reapply them if necessary.
809+
- If you're running a cluster, you'll need to carefully plan the upgrade process to minimize downtime and ensure cluster stability. This often involves a rolling upgrade strategy.
810+
- When using a `docker-compose.yml` make sure to update the desired version in the configuration file or the environment variable.

0 commit comments

Comments
 (0)