Containers

LXC is the Linux container technology. LXD is a high level user interface for LXC. If you are just starting out and have no legacy experience with Linux Containers, then get the latest greatest version that you can.

LXC and LXD are important tools you need to learn how to use. Take some time to study and learn how to set up containers to build your applications in.

The three major ways to isolate your projects from each other and your local operating system is to use a virtual environment, like Virtual Box, or even better, Qemu and KVM. You can use Docker Community Edition or LXC and D. You can also use Flatpak and Snapcraft.

Definitely try out Virtual Box. Install it and use it, so you will know how to do so, when that is the best solution for one of your projects. You can try out entire operating systems in Qemu or Virtual Box, which makes it a very valuable tool. And, its relatively easy to learn and get started using.

Docker CE, which is a commercial version of LXC, saves you from having to setup an entire operating system in your virtual environment. Even though Docker CE is a lot lighter than a Virtual Environment, it is still enterprise class technology that might be over kill for home brew websites.

LXD brings containerization down to the home office level. I’m pretty sure you can use any of these systems in your home office. You decide. LXD will be smaller and faster than the others.

LXD is LXC with a more advanced user interface. One important improvement is that it can be remotely controlled. Even though LXC and LXD use a separate operating system, they are much smaller than a virtual environment like Virtual Box or VMware.

Docker is a proprietary system, with a free and open source version, which enables you to build applications directly in the container, without an underlying operating system. It uses your computer’s kernel, which makes Docker containers smaller and lighter than virtual environments.

Qemu is a fast and open source virtualization technology that seems to require more technical skill to operate properly. After glancing at it’s website, I think I like it better than all the other options.

Qemu is a generic and open source machine emulator and virtualizer. It seems like a combination of containerization and virtualization. You can create containers with it and you can run KVM and XEN virtual machines with near native performance.

Get LXD or Docker or Qemu learned and set up on your system, so you can have a directory in your filesystem for each website or other application. Each application will be isolated from all the others and from your computer’s operating system. They’ll all be backed up and synchronized with a Github repository, so that you’ll be able to clone your projects and work on them on any computer.

You can also build separate containers for your database, your web server and your Django or Drupal. They all need to be properly containerized in a way that enables them to communicate with each other, without being able to inappropriately influence each other or your local operating system. You’ll find your own best practices.

Qemu, LXC, Git and SSH are components of your local development environment. You build your WordPress or Drupal, Flask or Django projects within LXC containers, which you manage in your LXD dashboard. You record and back everything up using Git and a remote repository and then you connect them to your live websites on remote commercial servers using SSH. The one thing I prefer using commercial servers for is web hosting, for security and stability.

Read lots of books and watch many videos about all these technologies. Take online courses and practice using these 21st century tools. Work on some aspect of your development workflow, as much as possible, for at least 5 days a week. Keep working. Keep seeking the truth and adding value to society, for as long as you are alive on earth.

So, you create a new directory for your new project in your Projects or Websites directory. The first thing you do is create a container in there. Then, you create a Git repository in the container. Then, you install Django or Flask. Use SQLite in your local development environment and PostgreSQL in your production websites. You’ll have to set up SSH keys for each project.

Another interesting option I’ve noticed, which I have never tried, even though it looks like it might be a good solution, is to get a Docker image of the entire project. You’ll have to research the Docker technology. Follow the directions to build a website in a docker container in your local development environment.