Managing development environments for projects involving multiple programming languages like Go for backend and JavaScript/TypeScript for frontend can quickly become complex. To address this, I've adopted Proxmox LXC containers coupled with VS Code Remote Development. This setup provides clean, isolated environments for each language. In this article, I'll guide you through the process of setting up this efficient workflow.
A machine running Proxmox.
Visual Studio Code with the Remote - SSH extension installed.
Let's begin by creating a dedicated LXC container for Go development. Within your Proxmox environment:
Create a new LXC container. I recommend using a template for the latest Long Term Support (LTS) version of Ubuntu. As of this writing, the latest LTS is 24.04
. Ensure you select a network interface that allows you to access the container.
Create a user within the newly created LXC. It's often convenient to use the same username as your local machine.
Update the package list and upgrade the installed packages within the LXC.
Install Go following the official installation instructions found at .
Identify the LXC's IP address by running ip a
. Note this address, as you'll need it for remote access. You can also add a new entry for this IP and a descriptive hostname in your local machine's .ssh/config
file for easier connections.
Connect via VS Code Remote. If you have the Remote - SSH extension installed, you'll see a remote explorer icon (><
) in the bottom-left corner of your VS Code window. Click this icon and select "Connect to Host...". You can then either enter the IP address of your Go LXC or select the hostname you configured in your .ssh/config
file.
Once connected, you can open a folder within the LXC and begin developing your Go project in an isolated environment.
Next, let's create an LXC container for Node.js development. The process is similar to the Go setup:
Create a new LXC container in Proxmox, again using the latest Ubuntu LTS template (24.04
).
Update packages within the new LXC after creation.
Install Node.js by following the official instructions available at .
Note the IP address of this LXC using ip a
and consider adding it to your .ssh/config
.
Connect to the Node.js LXC using the VS Code Remote - SSH extension, as described in the Go setup.
You now have a dedicated and isolated environment ready for your Node.js development.
Like any development approach, using LXC with VS Code Remote has its strengths and weaknesses:
Isolated Environments: Each project and language resides in its own container, preventing dependency conflicts and ensuring a clean development space.
Easy Backup and Restore: LXC containers can be easily backed up and restored, providing a robust way to manage your development environments.
Limited Scope: This setup is particularly well-suited for web applications and console applications. It might not be the optimal solution for low-level system development or mobile application development, which often require closer interaction with the host operating system or specific hardware.
This setup, leveraging Proxmox LXC for isolated environments and VS Code Remote for seamless development, has been my preferred workflow for a significant time. It offers a clean, organized, and easily manageable approach to handling projects with diverse technology stacks.