Dozzle is a lightweight, real-time log viewer for Docker containers, designed to help you monitor container logs easily from your browser. It is simple to set up and can be accessed securely to provide a clear view of your Docker container activities. In this guide, we will walk you through the installation of Dozzle on Ubuntu 22.04. Whether you are deploying Dozzle on a local server or using a Windows VPS UK, this guide will help you get started.

Step 1: Install Docker

If Docker is not already installed on your Ubuntu 22.04 system, you will need to install it first. Use the following commands to install Docker:


sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
            

After the installation is complete, start and enable Docker to run on boot:


sudo systemctl start docker
sudo systemctl enable docker
            

Docker is now installed and running, which is necessary for deploying Dozzle, whether on a local machine or in a VPS Windows Servers environment.

Step 2: Install Dozzle

With Docker installed, you can now run Dozzle as a Docker container. Use the following command to pull and run the Dozzle container:


sudo docker run -d --name=dozzle -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock dozzle/dozzle
            

This command runs Dozzle in detached mode (-d), maps port 8080 to your local machine, and mounts the Docker socket to allow Dozzle to access Docker container logs.

After running the command, Dozzle will be accessible via your server's IP address on port 8080. This setup works for both local deployments and cloud-based environments like a Windows VPS hosting UK.

Step 3: Access Dozzle

To access Dozzle, open your web browser and navigate to the following URL, replacing your-server-ip with your server's actual IP address:

http://your-server-ip:8080

This will take you to the Dozzle web interface, where you can view logs from all running Docker containers in real time. Whether you are hosting Dozzle locally or on a Windows VPS Italy, this interface provides a clear view of your container logs.

Step 4: Secure Dozzle with SSL

For production environments, it is important to secure Dozzle with SSL. You can use Let's Encrypt to obtain a free SSL certificate. First, install Certbot:

sudo apt install certbot python3-certbot-nginx -y

Next, create an Nginx configuration file for Dozzle:

sudo nano /etc/nginx/sites-available/dozzle.conf

Add the following configuration, replacing your-domain.com with your actual domain:


server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
            

Enable the site and restart Nginx:


sudo ln -s /etc/nginx/sites-available/dozzle.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx
            

Now, obtain an SSL certificate using Certbot:

sudo certbot --nginx -d your-domain.com

Certbot will automatically configure Nginx to use SSL, securing your Dozzle instance with HTTPS. This ensures secure access to your real-time logs, whether on a local server or hosted on a Windows VPS hosting UK environment.

Step 5: View and Monitor Docker Logs

Once Dozzle is up and running, you can monitor real-time logs from all your Docker containers directly from the web interface. The logs are displayed clearly, allowing you to easily monitor activity, debug issues, and stay updated on the status of your containers.

Dozzle provides a powerful yet simple interface for managing Docker logs, making it an excellent tool whether you're working locally or on a VPS Windows Servers platform.

You have successfully installed Dozzle, a real-time log viewer for Docker containers, on your Ubuntu 22.04 server. For reliable and scalable hosting solutions, consider using Windows VPS UK. They offer a variety of hosting plans, including windows virtual private servers, windows vps hosting, and windows virtual dedicated server hosting. Whether you're looking for windows vps italy or uk vps windows solutions, their hosting services provide the performance and flexibility needed to support your Docker environment.

Hai trovato utile questa risposta? 0 Utenti hanno trovato utile questa risposta (0 Voti)