Increase size of LXC Containers in Proxmox

As your Proxmox LXC container grows in usage, you might find yourself needing to increase its disk size. Fortunately, Proxmox provides a straightforward method to accomplish this. Follow the steps below to increase the size of your LXC container.

Step 1: Find the Container ID

To begin, you need to determine the ID of the container you wish to resize. You can use either the Proxmox GUI or the command-line interface (CLI) to accomplish this. If you prefer the CLI, follow the next step.

Step 2: Use the Command-Line Interface (CLI)

Open your terminal or SSH into your Proxmox server and enter the following command:

pct list

This command will display a list of all the containers along with their respective IDs. Note down the ID of the container you want to resize.

Step 3: Resize the Container

Now that you have the container ID, you can proceed with resizing the container’s root file system. Use the following command:

pct resize <vm-id> rootfs <size>

Replace <vm-id> with the container ID obtained in Step 2, and <size> with the desired new size for the root file system. Specify the size using a combination of a number and a unit (e.g., G for gigabytes). For example, if the container ID is 100 and you want to increase the root file system size to 100 gigabytes, the command would be:

pct resize 100 rootfs 100G

Conclusion

Increasing the size of your Proxmox LXC container is a simple process. By following the steps outlined above, you can effortlessly expand the disk space allocated to your container and accommodate its growing needs. Remember to execute these commands with caution, ensuring that you have a backup of your important data before making any modifications. With Proxmox, you have the flexibility to scale your LXC containers as your requirements evolve.