# AlmalinuxOS LXC Installation

<div style="text-align: right;">Antoine de Barbarin</div>

---


On the Proxmox web interface, click on the <img src="screenshots/Proxmox-createCT-button.png" alt="image-20250531211759646" style="zoom:70%;" /> button to create a new **LXC** (Linux container).

![proxmox view](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-interface-pfsense-install-00.png)


Fill the form with the hostname, passwords and the tag, then click on `Next`

![image-20250531212605350](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-01.png)



Then choose the almalinux image and click on `Next`

![image-20250531212219502](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-02.png)



Set the disk configuration and click on `Next`

![image-20250531212757016](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-03.png)



Keep a single CPU and click on `Next`

![image-20250531212859155](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-04.png)



Set the **RAM** at `1024MB` and the **SWAP** at `512MB` and click on `Next`

![image-20250531213026196](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-05.png)



Set the network at `vmbr4` corresponding to the **DMZ** interface and check `DHCP` on **IPv4**, then click on `Next`

![image-20250531213219760](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-06.png)



Set the **Domain** to `infrasi.lan` and keep the **DNS** to the default value, then click on `Next`

![image-20250531213354761](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-07.png)



Click on `Finish` to validate the configurations and create the **LXC**

![image-20250531213509856](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-08.png)



When it is finished, you can close the window

![image-20250531213620589](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-09.png)



Now we can see our newly created **LXC** appear, and going to **Network**, we can take note of its **MAC address** to add it to the static leases in the **DMZ DHCP** on **pfSense**

![image-20250531213843177](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-10.png)



To add it to the static leases, go to **Services > DHCP Server > DMZ** and click on `Add` at the bottom of the page, then fill the form like the following image

![image-20250531214521723](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-11.png)



Then you can click on <img src="https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-console-button.png" alt="console button" style="zoom:55%;" /> and then on <img src="https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-start-big-button.png" alt="start button" style="zoom:30%;" /> to start the **LXC**. When the system has booted, log in as `root` with the password provided in the creation form.

![image-20250531214738003](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-12.png)



Now that we are logged in, we can run the initial setup script:

```bash
#!/bin/bash

# update all packages and upgrade system
dnf update -y && dnf upgrade -y
# install basic and usefull packages
dnf install -y vim tar git wget bind-utils net-tools openssh-server

# add manager user with sudo privileges and modify the password
adduser manager
usermod -aG wheel manager
passwd manager

# start SSH server and enable it at boot
service sshd start && systemctl enable sshd
```



The only thing to do will be to type the manager's password when asked. All the rest is automatic.

After the upgrade from Almalinux 9.4 to Almalinux 9.6, reboot the **LXC** with the `reboot` command.

Now the **LXC** is setup and accessible via **SSH** using the **IP address** specified in **pfSense**.

![image-20250531215935772](https://docs.adebarbarin.com/uploads/images/gallery/2025-06/proxmox-lxc-13.png)