Report this

What is the reason for this report?

How do I persist Docker container logs on my Droplet?

Posted on March 24, 2025

I’m running a few containers on a DigitalOcean Droplet and using docker logs to check output.

The issue is that logs disappear when containers are restarted. What’s the best way to persist logs or send them somewhere reliable so I don’t lose them after restarts or reboots?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there 👋

By default, Docker uses the json-file logging driver, which stores logs locally, but they can get wiped on container restart depending on your settings.

To persist logs, you can:

  • Mount a volume to /var/lib/docker/containers (not ideal)

  • Use a logging driver like syslog, journald, or a remote option like fluentd or Papertrail

  • Or redirect logs inside your app to a mounted volume or external service

If you’re using App Platform, you can also forward logs to Papertrail directly from the dashboard:

https://docs.digitalocean.com/products/app-platform/how-to/forward-logs/

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.