Now that we have most of the necessities out of the way in our Homelab, we can start to focus on items that is going to add value to the homelab in general. As an example, WordPress is already running in or homelab, but if is a single container that is responsible for both PHP and MySQL. So today we are going to start looking at splitting our services so that each container or VM is only responsible for one task at a time. Today we are going to get our own separate MySQL server up and running and working, but using a LCX container again (due to its lightweight nature compared to a VM). One of the most valuable additions to any homelab is a MySQL instance, a powerful and widely used relational database system. But why would you want to run MySQL at home? Whether you’re a developer testing applications, a data enthusiast exploring structured storage, or a homelabber setting up self-hosted services like WordPress or Nextcloud, MySQL provides a solid foundation for storing and managing your data.
Step 1: Get the MySQL LXC Container
Log in to your Proxmox web address again and in the left navigation pane expand Datacenter
, then expand your main node, ex proxmox
. From there select the local
directory. In the middle navigation pane, select CT Templates
and the click in the main window. In the window that pops up, search for
MySql
and select the search result. Click to start the download process of the LXC Container Template. Once completed, we can create a new instance of this CT Template.
Step 2: Create a new container
Once we have the container template, we can click the button to create a new container. We need to use the following values:
Step 3: Configure Container
Select the newly created container from the left navigation pane. If it is not running, click Start
to start up the container. From the middle navigation pane, select Console
to open the integrated console. Log in with the username root
and the password selected in the General section of step 2.
A graphical screen will now open and prompt you a couple of things. Firstly, provide a password for Adminer (this is the web page used for the Turnkey LXC Container admin). After providing a password, and confirming the password, you will be asked to provide a password for the MySQL ‘remote’ user. Note that you can also log in with the adminer
user with the password you selected previously. After entering a password, and confirming it, for the remote
user, you will be prompted for the Turnkey Backup and domain management key again. Skip this for now and more to the next screen where you will be prompted if you want to received emails with security updates. Decide if you want, and move to the next screen. You will be prompted if you want to install the latest security updates. It is always a good idea to do so. Once install in completed, you will be shown the screen with the connection details. Take note of the adminer url as well as the IP address of the server. In the Advanced Menu
you can just quit.
Step 4: Connect via SQL Workbench
If you have MySQL Workbench installled, we can do a quick setup and connection test to ensure everything is working. If you don’t have it installed, you can get it from https://www.mysql.com/products/workbench/ Click the + icon next to MySQL Connections to create a new connection. Enter a connection name, enter the IP address and enter remote
as the user. Click Store in Vault
in the password section to enter the password. If you get a warning about version mismatches, just continue. Hopefully you will get the connection success message, which means that everything is working as expected.

MySQL Connection Details

Store Password in Vault

If you get the Connection Warning screen, just click the Continue Anyway button

Connection Success Messagebox
Bonus Step
If you want, you can also access your Technitium DNS server and add a new record that points to the IP address of the MySQL node. This means that you can just use mysql.local
in stead of using the IP address. There is no need to use our NGINX Reverse Proxy for this.

Adding a mysql record to the local zone so that we can use mysql.local. Note that the IP address of the MySQL container has changed because we added Address Reservation for the MySQL on the router to ensure we get the same IP address every time it restarts.
Conclusion
Now that we have our own MySQL instance up and running, we will be able to deploy services a lot faster that depends on it. We will also be able to be in control of the resource usage of the entire instance, which means we don’t have overheads of individual instances. This means better performance when running multiple apps and better control over resource usage.
In a future article, we will be installing WordPress (Again) but this time from a manual install, using this MySQL instance for the database in stead of running a separate one in the WordPress Container.