# How to upgrade the graylog in docker-compose?

**URL:** <https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679>\
**Category:** Graylog Central (peer support)\
**Tags:** docker\
**Created:** [July 7, 2022, 3:59pm UTC](https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679 "2022-07-07T15:59:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naresh-IT-Acheron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/naresh-it-acheron/32/12318_2.png) [@Naresh-IT-Acheron](https://community.graylog.org/u/Naresh-IT-Acheron)\
**Post date:** [July 7, 2022, 3:59pm UTC](https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679/1 "2022-07-07T15:59:16Z")

</div>

Hi,  
I am new to Graylog, and Docker too.  
I was able to deploy the Graylog by using the Docker compose.  
mongodb: # Mongodb service  
image: mongo:4.2  
elasticsearch: # ElasticSearch service  
image: [docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2](http://docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2)  
graylog:  
image: graylog/graylog:4.2

Once opened in the browser in the Notifications I got " You are running an outdated Graylog version"  
**Q1: How can upgrade this? without affecting any of my data may be in the future?**

I am using persistent Volumes.  
volumes:  
- mongo\_data:/data/db  
- es\_data:/usr/share/elasticsearch/data  
- graylog\_data:/usr/share/graylog/data  
volumes:  
mongo\_data:  
driver: local  
es\_data:  
driver: local  
graylog\_data:  
driver: local

Q2:How can I verify the data locations in my HOST?

Kind Request:  
FYI: I was not comfortable with the Graylog documentation, went with [How to Centralize Log Management with Graylog Docker](https://adamtheautomator.com/graylog-docker/)  
if any suggestions please let me know step by step.

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [July 7, 2022, 9:47pm UTC](https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679/2 "2022-07-07T21:47:20Z")

</div>

Hello

Upgrading Graylog Docker using Docker-compose. Before continuing insure you read the [changelogs](https://docs.graylog.org/docs/changelog). Check that system requirement’s are met. Last, make sure you pull the same image and match’s the current one installed.

1.Stop Graylog container  
2.Modify the docker-compose  
**FROM**

```auto
graylog:
    image: graylog/graylog-enterprise:4.2-jre11 <---- Here
    network_mode: bridge
    dns:
      - 8.8.8.8
      - 8.8.4.4

```

**TO**

```auto
graylog:
    image: graylog/graylog-enterprise:4.3-jre11 <---- Here
    network_mode: bridge
    dns:
      - 8.8.8.8
      - 8.8.4.4

```

3.Start Graylog container.  
4.Refreash Web Browser

Results:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/0/0b67efe1ddb193b3607865cf1f8929d9797c4e1b.png)

---

<div class="post-metadata">

**Author:** ![Naresh-IT-Acheron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/naresh-it-acheron/32/12318_2.png) [@Naresh-IT-Acheron](https://community.graylog.org/u/Naresh-IT-Acheron)\
**Post date:** [July 8, 2022, 5:11am UTC](https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679/3 "2022-07-08T05:11:38Z")

</div>

Hi gsmith,

Thank you for your time.

My bad I am not able to get you. mentioned my .yaml file below could you please add a view and give me an update.

FYI: I have tried changing the  
graylog:  
image: graylog/graylog:4.2  
**to**  
graylog:  
image: graylog/graylog:4.3.3

after that, I am not able to run the MongoDB container. it’s exited with code 64.  
i guess due to the persistent volume,  
**What is the way here to update without any data loss in DB and application?**

```auto
version: '2'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongodb: # Mongodb service
    image: mongo:4.2 # Version of Mongodb docker image 
    volumes:
      - mongo_data:/data/db # Persisted mongodb data
  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docker.html
  elasticsearch: # ElasticSearch service

    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2 # Version of elasticsearch image
    volumes:
      - es_data:/usr/share/elasticsearch/data # Persisted elasticsearch data 
    environment:
      - http.host=0.0.0.0
      - transport.host=localhost
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      # Unlimited amount of memory set for elasticsearch container
      memlock:
        soft: -1
        hard: -1
          # Resource limit for elasticsearch set to 1 gigabyte
    mem_limit: 1g
  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog:4.2 # Version of Graylog docker image
    volumes:
      - graylog_data:/usr/share/graylog/data # Persisted Graylog data
    environment:
      # CHANGE ME (must be at least 16 characters)!
      - GRAYLOG_PASSWORD_SECRET=<somesecret>
      # Password: admin
      - GRAYLOG_ROOT_PASSWORD_SHA2=<somepass>
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
      - GRAYLOG_WEB_ENDPOINT_URI=http://127.0.0.1:9000/api
        # Command to run as soon as components are started
    entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /docker-entrypoint.sh
      # Containers that Graylog depends on 
    links:
      - mongodb:mongo
      - elasticsearch
    restart: always # Graylog container set to always restart when stopped
    depends_on:
      - mongodb
      - elasticsearch
    ports:
      # Graylog web interface and REST API
      - 9000:9000
      # Syslog TCP
      - 1514:1514
      # Syslog UDP
      - 1514:1514/udp
      # GELF TCP
      - 12201:12201
      # GELF UDP
      - 12201:12201/udp
# Volumes for persisting data, see https://docs.docker.com/engine/admin/volumes/volumes/
volumes:
  mongo_data:
    driver: local
  es_data:
    driver: local
  graylog_data:
    driver: local

```

---

<div class="post-metadata">

**Author:** ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)\
**Post date:** [July 8, 2022, 9:45pm UTC](https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679/4 "2022-07-08T21:45:26Z")

</div>

Hello,

I’m not sure why Mongo container would not run. My procedure shown above is what I did.  
Perhaps a clarification on my steps will help.

1.Get container id

`root # docker ps`

```auto
834a83939ca9 graylog/graylog-enterprise:4.3-jre11 "tini -- /docker-ent…" 5 weeks ago Up About a minute (healthy) 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:5044->5044/tcp, :::5044->5044/tcp, 0.0.0.0:5055->5055/tcp, :::5055->5055/tcp, 0.0.0.0:8443->8443/tcp, 0.0.0.0:25->25/udp, :::8443->8443/tcp, :::25->25/udp, 0.0.0.0:8514->8514/tcp, :::8514->8514/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, 0.0.0.0:8514->8514/udp, :::9300->9300/tcp, :::8514->8514/udp, 0.0.0.0:9515->9515/tcp, :::9515->9515/tcp, 0.0.0.0:9515->9515/udp, :::9515->9515/udp, 0.0.0.0:13301-13302->13301-13302/tcp, :::13301-13302->13301-13302/tcp, 0.0.0.0:49180->1281/tcp, :::49180->1281/tcp, 0.0.0.0:49179->1525/tcp, :::49179->1525/tcp bin_graylog_1
871e601dbe2f docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2-amd64 "/tini -- /usr/local…" 2 months ago Up 4 weeks 9200/tcp, 9300/tcp bin_elasticsearch_1
791ee497f251 b313026e6fbd "/tini -- /usr/local…" 2 months ago Up 6 weeks 9200/tcp, 9300/tcp home_elasticsearch_1
025df2d373ff aa61e4b09cef "docker-entrypoint.s…" 2 months ago Up 6 weeks 27017/tcp home_mongodb_1
040d0a505874 mongo:4.4 "docker-entrypoint.s…" 2 months ago Up 4 weeks 27017/tcp bin_mongodb_1

```

2.Stop Graylog container

` root# docker stop 834a83939ca9`

3.Find new image

`root# docker images`

```auto
root@ansible:/usr/local/bin# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
kong latest e457308de474 3 weeks ago 139MB
graylog/graylog-enterprise 4.3-jre11 ec6db44b0465 7 weeks ago 841MB
mongo 4.4 aa61e4b09cef 2 months ago 438MB
postgres 9.6 027ccf656dc1 4 months ago 200MB
docker.elastic.co/elasticsearch/elasticsearch-oss 7.10.2-amd64 b313026e6fbd 18 months ago 699MB
pantsel/konga latest 113950dafdbb 2 years ago 409MB

```

4.Modify the docker-compose YAML file with new image name as shown above.

```auto
graylog:
    image: graylog/graylog-enterprise:4.3-jre11
    network_mode: bridge

```

5.Start Graylog container

`root# docker start 834a83939ca9`

Example of the commands used.

```auto
root@ansible:/usr/local/bin# docker stop 834a83939ca9
834a83939ca9
root@ansible:/usr/local/bin# docker start 834a83939ca9
834a83939ca9
root@ansible:/usr/local/bin#

```

**NOTE** : Mongo and Elasticsearch should still be active during this time.

6.Tail container logs to insure no issues.

`root# docker logs -f 834a83939ca9`

Results:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/c/cc036d028441334becbab838986d32c9f1925ac2.png)

I actually walk through each step above to insure it works. If this was tried already I would look into container logs to find out why.

EDIT: I forgot to mention, if your using the Graylog configuration file ( graylog.conf) within the container you may need to insure its correct.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [July 22, 2022, 9:46pm UTC](https://community.graylog.org/t/how-to-upgrade-the-graylog-in-docker-compose/24679/5 "2022-07-22T21:46:00Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
