Table of Contents
Files server
The purpose of this training is to facilitate the setup, management, and maintenance of a self-hosted personal website and related services.
Required equipment
Hardware requirements
- A USB key to copy Proxmox install https://enterprise.proxmox.com/iso/proxmox-ve_8.4-1.iso (if the Proxmox way is chosen)
- A computer connected to the Internet that will be dedicated to hosting services, otherwise use a hosting service
Optional services
In my case, I chose to have an authoritative domain name server, but this is not mandatory.
The SNI reverse proxy is only necessary if you want to have several virtual machines (or containers) sharing the same public IPv4 address.
As can be seen in the diagram, IPv6 is easier to configure than when you only have one public IPv4 address.
Installations
I recommend installing a hypervisor (Proxmox) to host the virtual machines or containers for the website and associated services. It is possible to use a hypervisor other than Proxmox, such as virt-manager, VirtualBox, etc.
In any case, it is preferable to configure the network in bridge mode to avoid having to manage NAT redirection.
Proxmox uses bridges by default, which suits our needs.
Proxmox
- Copy the Proxmox ISO to the USB key and boot the computer from it.
- Follow the installation steps: xfs, root:30GB.
- Proxmox configuration.
- Add the user userhttps://your_server_proxmox:8006/# v1:0:18:4:::::::14
- Give them admin rights: https://your_server_proxmox:8006/#v1:0:18:4:::::::6
- Edit /etc/ssh/sshd_config: permitrootlogin no
Yunohost
Yunohost can be installed in two ways in Proxmox: as a virtual machine or as a container. This will depend on your process isolation requirements.
I recommend installing Yunohost as a container, but if you want to install it as a virtual machine, instructions are available here: Yunohost as a virtual machine
Yunohost installation (in container)
Yunohost is installed in an existing container:
Yunohost is based on Debian, so I install a Debian container:
(documentation: https://pve.proxmox.com/wiki/Linux_Container#pct_container_images)
Here are some commands to run as root in the Proxmox terminal to add the container images:
pveam update
(updates the list of available container images)
pveam available --section system | grep debian
(displays the list of Debian containers only)
pveam download local debian-12-standard_12.7-1_amd64.tar.zst
(downloads the latest available Debian image)
- When the download is complete, you can create a container from this image. 20 GB of disk space should be sufficient.
- Start the container…
- Once in the container as root, retrieve the yunohost installation script and execute it:
cd /root apt update wget install.yunohost.org -O install.yunohost.sh chmod +x install.yunohost.sh /root/install.yunohost.sh
Once the basic installation is complete, simply go to the web browser to continue. Or type ‘yunohost tools postinstall’ in the command line.
Get a domain name
- either with yunohost
- or from a registrar
Once the domain name is registered, you just need to generate the certificate on the Yunohost/admin side.
Adding an application
Choose from:
IPv4 only: Opening ports (and NAT redirects)
- Identify the ports to be opened.
- Open them on the Internet box side and specify the redirect.
- If you have set up an SNI proxy server, you will need to redirect ports 80 and 443 to the SNI proxy server.
Keep in mind that NAT issues do not exist in ipv6 (unless you have CGNAT, but in that case I recommend changing your Internet service provider).
In ipv6, the machine is directly connected to the Internet, with all ports exposed on the public IP (which starts with 2).
Backups (very important)
Yunohost is capable of backing up applications, but it does not back up itself. That's why I use Yunohost in a virtual machine (or container) and have Proxmox perform the backup.
However, a backup should not remain on the same hard drive as its source and should be stored in a different geographical location.
In our case, using a second hard drive would already be a good solution.