Sailing the Self-Hosting Sea: A Docker Journey

First Stop: The Land of Linux

Before I fully immersed myself in the Docker ecosystem, I really wanted to familiarize myself with Linux OS. I’ve worked with Kalii Linux for ethical hacking and computer forensic courses but it command line isn’t as natural to me as Windows. Its influence on Docker and the container landscape cannot be overstated. But why is Linux proficiency so critical?

  • Command Line Mastery – Most Docker actions require command line acumen. From simple tasks like viewing the contents of a directory (ls) to altering file permissions (chmod), Linux commands help us in the Docker journey.
  • Grasping Directory Structures – An understanding of the Linux directory structure is akin to having a map when you don’t know where you’re going. Knowing where data resides, how to access it, and how to modify it is crucial in the Docker environment.

For me, it was important to have things in the right place with the right access for the right users. Making users, knowing their PUID and GUID, what they have access to in my file storage, and creating file structures with proper naming conventions was crucial.

The Allure of Containers and Why I’m Hooked

Containers are revolutionizing software deployment. Even though I haven’t made my own container application, here are some reasons why developers use containers and what made me fall in love with their practicality:

  • Efficiency – Containers encapsulate an entire environment without the overhead of a full OS, making them incredibly lightweight.
  • Isolation – Each application can reside in its own environment with specific dependencies. No more “It works on my machine” scenarios.
  • Flexibility – The ability to quickly deploy, modify, or delete a container means faster development and modifications of container applications.
  • Portability – Build once, run anywhere. This mantra defines the promise of Docker and containers.
  • Loosely Coupled – Applications are divided into independent services, each in its container, allowing individual scaling and deployment for better agility.

Docker & Spinning up the Perfect Container

Spinning up containers in Docker has been so fun and easy. There’s a docker container out there for almost any use case. Infrastructure, Monitoring, Media, IoT Management, and many more.

I for instance have spun up VPN servers, Monitoring tools, a Proxy manager, a local and recursive and DNS container just to name a few. But here’s a link of a large amount of containers you can have fun with self hosting: https://github.com/awesome-selfhosted/awesome-selfhosted

  • Images and Containers: Using Docker, you can create or pull images – which are the blueprint to any Docker application – and then launch them as containers. With a few simple docker run commands, you can bring an entire environment to life.
  • Networking and Storage: Docker offers a robust set of options for networking containers and attaching storage. I’ve played with bridge networks, overlay networks, and even host networking. Each offers its unique advantages and challenges.

Portainer GUI Central Management

If Docker is the ship, Portainer is the captain’s wheel. This powerful GUI provides:
  • Central Management – A unified view of all my Docker resources.
  • Simplified Operations – No need to remember complex command lines. Deploying a new container or network is just a few clicks away.
  • Organized Environment – Tags, groups, and labels have made managing a growing Docker environment a breeze.

I recommend this for any folks who aren’t command line warriors or who are but just want the simplicity of a user interface. You can also use docker compose by using the web editor in Portainer, uploading a local life, or pulling from a git repository.

NFS and Data Management

My Docker journey wasn’t complete without a reliable data storage solution. Using Network File System (NFS), I implemented a structure to keep large data repositories:

  • NAS Storage to Proxmox – My data begins its journey at the NAS, a centralized repository, and then gets mounted to the Proxmox server.
  • Proxmox to LXC – Through bind mounts, the data is made accessible to the LXC containers.
  • LXC to Docker – Within the LXC, Docker containers are granted access to specific directories, ensuring data integrity and isolation.

I also made this storage system persistent should the server go down by adding the mount entry to the /etc/fstab file. This /etc/fstab file lists all available disks and disk partitions and indicates how they should be integrated into the system’s file system.

Securing My Things and Stuff

In today’s digital age, security isn’t optional. Here’s how a general idea on how I fortified my setup:

  • VPN – A secure tunnel ensures all incoming and outgoing traffic is encrypted and shielded from prying eyes. I also have a container that my other containers use as a VPN.
  • Monitoring – Using monitoring containers and tools, I can keep an eye on container health, network anomalies, and resource utilization.
  • Firewall & Networking – Properly configured firewalls coupled with Docker’s network isolation ensure minimal exposure and reduce potential attack vectors.
  • Data Encryption – By encrypting data transfers between my NAS and server, I ensure data confidentiality and integrity.

Want to Join the Adventure?:

If you’ve got a curious heart and sea-faring spirit, why not dive into Docker too? Here’s how you can set your own ship afloat:

  • Install Docker – A simple ‘apt-get install docker-ce’ should do the trick for most.
  • Hoist the Portainer Flag – ‘docker run -d -p 9000:9000 portainer/portainer’ and navigate to ‘http://<YOUR-IP>:9000/’ in your browser.

Final Thoughts and Charting Future Waters

My journey has been rewarding, filled with challenges, learnings, and a lot of fun. Hopefully, sometime soon I can make my own container! I love a good challenge and learning experience so it would be right up my alley.  As I chart my course for deeper Docker explorations, I hope to encounter fellow sailors, share tales, and learn from their adventures.

Happy containerizing!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top