transferring an existing droplet into a docker image


I’m new to all this and looking for some general advice on what’s the best way of transfering my existing DigitalOcean image (droplet) into a docker image.

Thankfully, i’m still at the beginning of my project and I haven’t done the code yet, only the configuration/security of the Ubuntu OS along with SSL certificates are done.

My main concerns are:

  1. Do I have to recreate the docker image/configuration, or can I just take the image from DigitalOcean?
  2. If no1 is not possible, how do I reload my SSL certificates using Let’s Encrypt/certbot? I’ve already backed up the “/etc/letsencrypt” folder, do I just need to upload that (after what is done)?


I can’t seem to find any tutorials for the above two questions. Any help would be greatly appreciated.

Thank you.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello friend!

Happy to help as best I can. Docker might not be the right solution for you, given the question. Docker is at it’s best when you separate out each part and create a dockerfile for each container that allows you to spin up new instances of that environment at any time. For example, in a web stack I might have a separate container for each item:

  1. MySQL
  2. Web server
  3. Interpreter (PHP, for example)

You would definitely need to build with Docker in mind rather than build outside and then move into Docker, as it would involve re-tracing a lot of your steps.

For your #2 question there, I assume by reloading the LE cert you mean renewing. Let me know if that is an incorrect assumption. Otherwise, this part of the tutorial will help with that:—-verifying-certbot-auto-renewal

Kind Regards, Jarland