How to upgrade OnlyOffice document server

Few months back I wrote an article on how to install OnlyOffice document server on Ubuntu 22.04 server and connect it to your Nextcloud instance. But what if you want to upgrade the document server at some stage? So here today I am going to guide you step by step how to upgrade OnlyOffice document server.

logo_onlyoffice_transparent

Looking to install OnlyOffice document server from scratch? Click here

If you are here to upgrade the container to the latest version, read on how to perform the upgrade.

1- Upgrade document server

The first thing we will do is find out our container ID.

docker ps

Once we have the ID, we will issue a command to stop the container.

docker stop CONTAINER_ID

Now it’s time to upgrade to the latest version of the document server. For that we will use docker pull command.

docker pull onlyoffice/documentserver:latest

Once done, next is to start the latest container with the following command (this command should be the same as it was for starting the docker initially).

docker run -i -t -d -p 127.0.0.1:9981:80 --restart=always \
    -e JWT_ENABLED=true \
    -e JWT_SECRET=7bSds623nf2341k932ds2 \
    -e JWT_HEADER=Authorization \
    -e JWT_IN_BODY=true \
    -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data onlyoffice/documentserver

That’s it, no other changes are required. You should be able to see the newest version in Nextcloud now.

2- Cleanup

You may have old containers and images at this time. If you want to remove them and free up some space, read on to clean things up. Otherwise just skip this step.

Note: be-careful here what you are removing. Make sure you remove the desired container and image.

docker rm OLD_CONTAINER_ID

This will remove the container. Now to free up some space you can remove the image too.

docker images -a

Once you have the image ID, run the following command to remove the image.

docker rmi OLD_IMAGE_ID