Welcome to the repository for documenting my journey in managing an on-premises Ubuntu server using LXC/LXD, Docker and Portainer for containerized application hosting. This repository includes setup instructions, storage configurations, and network configurations.
The primary motivation behind this project is to hone my skills as a DevOps Engineer and to gain hands-on experience in system operations. While cloud-based VMs are managed by providers, I wanted to take on the challenge of managing a server myself.
- Architecture: x86-64
- Storage: 500GB HDD
- Memory: 4GB RAM
- OS: Ubuntu 24.04 LTS
- Documentation: Detailed guides and instructions for setting up and managing the server.
- Configuration Files: Sample configuration files for various services and settings.
- Initial server setup
- Initial LXD setup
- Docker and Portainer installation and configuration
- Storage management
- Network & DNS configuration
- Container management
Docker is used to create, manage, and configure containers on the server, with Portainer providing a web-based interface for easier management. The following are key steps and configurations:
- Installation: Docker installed using the official Docker repository to ensure the latest stable version.
- Container Creation: Containers are created using Docker images for each application.
- Network Configuration for Containers: Set up NAT and bridged networks, depending on the needs of each containerized application.
- Resource Allocation: Memory and storage resources are allocated to each container to optimize server performance.
- Create a container:
docker run -d --name my-container ubuntu:24.04 - List containers:
docker ps - Manage container storage: Docker volumes and bind mounts
| Command | Description |
|---|---|
df -h |
Check available disk space |
free -h |
Display memory usage |
docker ps |
List all running Docker containers |
docker start <container-name> |
Start a specific container |
docker stop <container-name> |
Stop a specific container |
docker rm <container-name> |
Delete a container |
docker volume create <volume-name> |
Create a Docker volume |
docker-compose up -d |
Start services defined in a Docker Compose file |
LXD is used to create, manage, and configure Linux containers (LXC) on the server. The following are key steps and configurations:
- Installation: LXD installed using
snapto ensure the latest stable version. - Container Creation: Containers are created using images, such as
ubuntu:24.04, for each application. - Network Configuration for Containers: Set up NAT and bridged networks, depending on the needs of each containerized application.
- Resource Allocation: Memory and storage resources are allocated to each container to optimize server performance.
The server uses WiFi for network connectivity, which can be complex to configure. The following ports are used for various services:
| Port | Service | Description |
|---|---|---|
| 80 | NGINX (Reverse Proxy) | Forwarding requests for Jenkins and other services. |
| 8080 | Jenkins (Proxied to 80) | Automation server (proxied via NGINX). |
| 8443 | LXD WebUI | LXD Web interface. |
| 8000 | Portainer | Portainer management endpoint. |
| 9443 | Portainer (HTTPS) | Secure management endpoint. |
| 8081 | cAdvisor | Container metrics and insights. |
| 6379 | Redis | In-memory database. |
| 3000 | Grafana | Monitoring and visualization. |
| 9090 | Prometheus | Metrics monitoring system. |
| 9100 | Node Exporter | System metrics for Prometheus. |
This repository is primarily for documenting my learning experience, but contributions or feedback are welcome. If you have suggestions or improvements, feel free to open an issue or submit a pull request.
For any questions or suggestions, feel free to open an issue or contact me directly.

