Follow logs on a docker container on a remote server

To follow the log files in a container on a dedicated server:

ssh -t <servername> "sudo docker container logs <containername> --follow" 

This assumes you have a ssh keypair set up on your server. (ssh-keygen -t ed25519 copy the pvt key to your workstation .ssh folder and create an entry in .ssh/config)

Donโ€™t forget to add your topic to the Howto/FAQ Wiki!

In case of Nextcloud Docker community image (likely AiO as well) this logs donโ€™t contain application log aka nextcloud.log and only show webserver log.

introduction into Nextcloud logging 101: logging, which logs exist, how to access and understand

1 Like