<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>DIYLABHub.com</title><description>Empowering Your Home Lab Innovations</description><link>https://diylabhub.com/</link><item><title>Comprehensive Guide to Self-Hosting Kokoro Web on Ubuntu 20.04+ with Docker</title><link>https://diylabhub.com/comprehensive-guide-to-self-hosting-kokoro-web-on-ubuntu-20-04-with-docker/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-self-hosting-kokoro-web-on-ubuntu-20-04-with-docker/</guid><pubDate>Sat, 05 Apr 2025 18:35:01 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Kokoro Web is a powerful AI text-to-speech solution that lets you create natural-sounding voices directly in your browser without installation requirements. This free and open-source tool can be self-hosted to provide an OpenAI-compatible API for your applications, offering high-quality voice generation capabilities comparable to leading commercial services. This guide will walk you through setting up Kokoro Web on Ubuntu systems using Docker, with special configurations for WSL access and local website integration with Pi-hole.&lt;/p&gt;&lt;h2 id=&quot;introduction-to-kokoro-web&quot;&gt;Introduction to Kokoro Web&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-to-kokoro-web&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Kokoro Web is powered by the hexgrad/Kokoro-82M model, a lightweight yet capable 82 million parameter text-to-speech model available on Hugging Face. Despite its relatively small size, it delivers impressive quality comparable to larger models while being significantly faster and more resource-efficient. With Apache-licensed weights, you can deploy Kokoro anywhere from production environments to personal projects&lt;a href=&quot;https://github.com/eduardolat/kokoro-web&quot;&gt;^2&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Key features include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Zero installation requirements for end-users&lt;/li&gt;&lt;li&gt;Self-hosting capabilities with OpenAI API compatibility&lt;/li&gt;&lt;li&gt;Support for various language accents&lt;/li&gt;&lt;li&gt;Voice customization options&lt;/li&gt;&lt;li&gt;WebGPU acceleration for supported browsers&lt;/li&gt;&lt;li&gt;Completely free for both personal and commercial use&lt;a href=&quot;https://github.com/eduardolat/kokoro-web&quot;&gt;^2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;CPU-only setup&lt;/strong&gt;: Any modern CPU with at least 2 cores&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GPU-accelerated setup (optional)&lt;/strong&gt;: NVIDIA GPU with CUDA support&lt;/li&gt;&lt;li&gt;Minimum 4GB RAM (8GB recommended)&lt;/li&gt;&lt;li&gt;At least 10GB free disk space&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer&lt;/li&gt;&lt;li&gt;Root or sudo privileges on your system&lt;/li&gt;&lt;li&gt;Basic knowledge of terminal commands&lt;/li&gt;&lt;li&gt;Internet connection for downloading required packages and Docker images&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;setting-up-docker-on-ubuntu&quot;&gt;Setting Up Docker on Ubuntu&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-docker-on-ubuntu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;for-users-who-dont-have-docker-installed&quot;&gt;For Users Who Don&amp;#39;t Have Docker Installed&lt;a class=&quot;h-anchor&quot; href=&quot;#for-users-who-dont-have-docker-installed&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you don&amp;#39;t already have Docker installed on your Ubuntu system, follow these steps to install Docker Engine and Docker Compose.&lt;/p&gt;&lt;h4 id=&quot;step-1-set-up-dockers-repository&quot;&gt;Step 1: Set up Docker&amp;#39;s repository&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-set-up-dockers-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Update the package index and install dependencies
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add Docker&amp;#39;s official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Set up the repository
echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-2-install-docker-engine-and-docker-compose&quot;&gt;Step 2: Install Docker Engine and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker-engine-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Update the package index again
sudo apt-get update
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Install Docker Engine, containerd, and Docker Compose
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-3-verify-the-installation&quot;&gt;Step 3: Verify the installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-verify-the-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;# Run the hello-world container to verify Docker works
sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-4-add-your-user-to-the-docker-group-avoid-using-sudo-with-docker&quot;&gt;Step 4: Add your user to the docker group (avoid using sudo with Docker)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-add-your-user-to-the-docker-group-avoid-using-sudo-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add your user to the docker group
sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Apply the new group membership (alternatively, you can log out and back in)
newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Verify you can run Docker commands without sudo
docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;for-users-who-already-have-docker-installed&quot;&gt;For Users Who Already Have Docker Installed&lt;a class=&quot;h-anchor&quot; href=&quot;#for-users-who-already-have-docker-installed&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you already have Docker installed, make sure it&amp;#39;s up to date:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Update your package list
sudo apt-get update
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Upgrade Docker packages
sudo apt-get upgrade docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Verify Docker is working correctly
docker --version
docker compose version
docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;installing-and-configuring-kokoro-web-with-docker&quot;&gt;Installing and Configuring Kokoro Web with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-and-configuring-kokoro-web-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-create-a-directory-structure-for-kokoro-web&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a directory structure for Kokoro Web&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-directory-structure-for-kokoro-web&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create directories for Kokoro Web data and configuration
mkdir -p ~/docker_data/kokoro-web/cache
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-create-a-docker-compose-file&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Docker Compose file&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-a-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Navigate to the Kokoro Web directory
cd ~/docker_data/kokoro-web
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a docker-compose.yml file using your preferred text editor
nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Paste the following configuration into the file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;version: &amp;#39;3.8&amp;#39;
services:
  kokoro-web:
    image: ghcr.io/eduardolat/kokoro-web:latest
    container_name: kokoro-web
    restart: unless-stopped
    ports:
      - &amp;quot;3000:3000&amp;quot;
    environment:
      - KW_SECRET_API_KEY=your-secure-api-key  # Change this to a strong, unique key
      - TZ=UTC  # Set to your timezone if needed
    volumes:
      - ./cache:/kokoro/cache  # Cache downloaded models and voices
    networks:
      - kokoro-network

networks:
  kokoro-network:
    driver: bridge
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit the editor (in nano, press Ctrl+X, then Y, then Enter).&lt;/p&gt;&lt;h3 id=&quot;step-3-start-the-kokoro-web-service&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start the Kokoro Web service&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-start-the-kokoro-web-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Start the Kokoro Web container in detached mode
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check if the container is running
docker ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see a container named &amp;quot;kokoro-web&amp;quot; in the list, indicating that the service is running.&lt;/p&gt;&lt;h3 id=&quot;step-4-access-the-web-interface&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access the web interface&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-access-the-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;After starting the container, you can access the Kokoro Web interface by opening a web browser and navigating to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://localhost:3000
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The API interface can be accessed at:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://localhost:3000/api/v1/index.html
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;securing-your-kokoro-web-installation&quot;&gt;Securing Your Kokoro Web Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-your-kokoro-web-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-set-a-strong-api-key&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set a strong API key&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-set-a-strong-api-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Edit your docker-compose.yml file to change the &lt;code&gt;KW_SECRET_API_KEY&lt;/code&gt; to a strong, unique value:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Generate a secure random string for the API key
API_KEY=$(openssl rand -base64 32)
echo &amp;quot;Your generated API key: $API_KEY&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Edit the docker-compose.yml file
nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Update the &lt;code&gt;KW_SECRET_API_KEY&lt;/code&gt; value, save the file, and restart the container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Restart the container to apply changes
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-using-non-root-user-in-docker-optional-but-recommended&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Using non-root user in Docker (optional but recommended)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-using-non-root-user-in-docker-optional-but-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To improve security, you can ensure the Docker container runs as a non-root user by adding user and group settings to your docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;services:
  kokoro-web:
    image: ghcr.io/eduardolat/kokoro-web:latest
    user: 1000:1000  # Use the user ID and group ID that matches your host user
    # ... rest of your configuration
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-set-appropriate-file-permissions&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set appropriate file permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-set-appropriate-file-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Ensure the cache directory has the right permissions
sudo chown -R 1000:1000 ~/docker_data/kokoro-web/cache
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-implement-network-restrictions&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Implement network restrictions&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-implement-network-restrictions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you want to restrict access to your Kokoro Web instance to only your local network, you can modify the ports configuration in docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ports:
  - &amp;quot;127.0.0.1:3000:3000&amp;quot;  # Only accessible from localhost
  # OR
  - &amp;quot;192.168.1.100:3000:3000&amp;quot;  # Only accessible from your specific IP
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;integrating-with-windows-subsystem-for-linux-wsl&quot;&gt;Integrating with Windows Subsystem for Linux (WSL)&lt;a class=&quot;h-anchor&quot; href=&quot;#integrating-with-windows-subsystem-for-linux-wsl&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you&amp;#39;re running Ubuntu through WSL, you can access Kokoro Web both from your WSL environment and from Windows.&lt;/p&gt;&lt;h3 id=&quot;setting-up-docker-with-wsl2&quot;&gt;Setting up Docker with WSL2&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-docker-with-wsl2&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;step-1-ensure-wsl2-is-properly-configured&quot;&gt;Step 1: Ensure WSL2 is properly configured&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-ensure-wsl2-is-properly-configured&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;If you haven&amp;#39;t already set up WSL2 with Ubuntu, follow these steps on your Windows machine:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Enable WSL2 in Windows features&lt;/li&gt;&lt;li&gt;Install Ubuntu from the Microsoft Store&lt;/li&gt;&lt;li&gt;Set WSL2 as the default version&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Run these in PowerShell with administrator privileges
wsl --install
wsl --set-default-version 2
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-2-install-docker-desktop-for-windows&quot;&gt;Step 2: Install Docker Desktop for Windows&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker-desktop-for-windows&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;For WSL2 integration, it&amp;#39;s recommended to use Docker Desktop for Windows:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Download and install &lt;a href=&quot;https://www.docker.com/products/docker-desktop&quot;&gt;Docker Desktop for Windows&lt;/a&gt;&lt;/li&gt;&lt;li&gt;During installation, ensure &amp;quot;Use WSL 2 instead of Hyper-V&amp;quot; is selected&lt;/li&gt;&lt;li&gt;After installation, open Docker Desktop settings and enable integration with your Ubuntu distribution under &amp;quot;Resources &amp;gt; WSL Integration&amp;quot;&lt;/li&gt;&lt;/ol&gt;&lt;h4 id=&quot;step-3-access-kokoro-web-from-windows&quot;&gt;Step 3: Access Kokoro Web from Windows&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-access-kokoro-web-from-windows&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;After setting up Docker Desktop with WSL2 integration and running the Kokoro Web container in your Ubuntu WSL distribution, you can access the web interface from Windows through:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://localhost:3000
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Or using the IP address of your WSL2 distribution:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://wsl-ip-address:3000
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You can find your WSL2 IP address using this command in Ubuntu:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ip addr show eth0 | grep -oP &amp;#39;(?&amp;amp;lt;=inet\s)\d+(\.\d+){3}&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;integrating-with-pi-hole-for-local-domain-access&quot;&gt;Integrating with Pi-hole for Local Domain Access&lt;a class=&quot;h-anchor&quot; href=&quot;#integrating-with-pi-hole-for-local-domain-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-set-up-a-local-domain-with-pi-hole&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set up a local domain with Pi-hole&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-set-up-a-local-domain-with-pi-hole&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To access your Kokoro Web instance using a friendly domain name (e.g., kokoro.local), you can configure Pi-hole to resolve this domain to your server&amp;#39;s IP address.&lt;/p&gt;&lt;h4 id=&quot;method-1-using-pi-holes-local-dns-records&quot;&gt;Method 1: Using Pi-hole&amp;#39;s Local DNS Records&lt;a class=&quot;h-anchor&quot; href=&quot;#method-1-using-pi-holes-local-dns-records&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;ol&gt;&lt;li&gt;Access your Pi-hole admin interface (typically http://pi.hole/admin)&lt;/li&gt;&lt;li&gt;Navigate to &amp;quot;Local DNS &amp;gt; DNS Records&amp;quot;&lt;/li&gt;&lt;li&gt;Add a new entry with:&lt;ul&gt;&lt;li&gt;Domain: kokoro.local&lt;/li&gt;&lt;li&gt;IP Address: [Your server&amp;#39;s IP address]&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Save the changes&lt;/li&gt;&lt;/ol&gt;&lt;h4 id=&quot;method-2-using-etchosts-file-on-the-pi-hole-server&quot;&gt;Method 2: Using /etc/hosts file on the Pi-hole server&lt;a class=&quot;h-anchor&quot; href=&quot;#method-2-using-etchosts-file-on-the-pi-hole-server&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# SSH into your Pi-hole server
ssh user@pi-hole-server
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Edit the hosts file
sudo nano /etc/hosts
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add this line to the file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;192.168.1.xxx  kokoro.local
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;quot;192.168.1.xxx&amp;quot; with your Kokoro Web server&amp;#39;s IP address.&lt;/p&gt;&lt;p&gt;Save and exit the editor, then restart the DNS service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Restart Pi-hole DNS service
sudo pihole restartdns
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-configure-traefik-for-local-domain-routing-optional&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Traefik for local domain routing (optional)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-configure-traefik-for-local-domain-routing-optional&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For more advanced setups, you can use Traefik as a reverse proxy to handle local domain routing. This is particularly useful if you&amp;#39;re hosting multiple services on the same server.&lt;/p&gt;&lt;h4 id=&quot;step-1-create-a-traefik-configuration&quot;&gt;Step 1: Create a Traefik configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-traefik-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;First, create a new directory for Traefik:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/traefik/{config,data}
cd ~/docker_data/traefik
touch docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Edit the docker-compose.yml file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;version: &amp;#39;3.8&amp;#39;
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    restart: unless-stopped
    ports:
      - &amp;quot;80:80&amp;quot;
      - &amp;quot;443:443&amp;quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.yml:/etc/traefik/traefik.yml:ro
      - ./config/config.yml:/etc/traefik/config.yml:ro
      - ./data/certificates:/certificates
    networks:
      - proxy

networks:
  proxy:
    external: true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a Traefik configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/traefik/config
nano ~/docker_data/traefik/config/traefik.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;api:
  dashboard: true

entryPoints:
  http:
    address: &amp;quot;:80&amp;quot;
  https:
    address: &amp;quot;:443&amp;quot;

providers:
  docker:
    endpoint: &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault: false
  file:
    filename: /etc/traefik/config.yml

log:
  level: INFO
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a configuration file for your services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/traefik/config/config.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http:
  routers:
    kokoro:
      rule: &amp;quot;Host(`kokoro.local`)&amp;quot;
      service: kokoro
      entryPoints:
        - http

  services:
    kokoro:
      loadBalancer:
        servers:
          - url: &amp;quot;http://kokoro-web:3000&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-2-create-a-docker-network&quot;&gt;Step 2: Create a Docker network&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-a-docker-network&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker network create proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-3-update-the-kokoro-web-docker-composeyml-file&quot;&gt;Step 3: Update the Kokoro Web docker-compose.yml file&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-update-the-kokoro-web-docker-composeyml-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Edit your Kokoro Web docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/kokoro-web/docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Update it with network and label configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;version: &amp;#39;3.8&amp;#39;
services:
  kokoro-web:
    image: ghcr.io/eduardolat/kokoro-web:latest
    container_name: kokoro-web
    restart: unless-stopped
    environment:
      - KW_SECRET_API_KEY=your-secure-api-key
      - TZ=UTC
    volumes:
      - ./cache:/kokoro/cache
    networks:
      - kokoro-network
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.kokoro.rule=Host(`kokoro.local`)&amp;quot;
      - &amp;quot;traefik.http.services.kokoro.loadbalancer.server.port=3000&amp;quot;

networks:
  kokoro-network:
    driver: bridge
  proxy:
    external: true
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-4-start-traefik-and-restart-kokoro-web&quot;&gt;Step 4: Start Traefik and restart Kokoro Web&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-start-traefik-and-restart-kokoro-web&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Start Traefik
cd ~/docker_data/traefik
docker compose up -d

# Restart Kokoro Web with updated configuration
cd ~/docker_data/kokoro-web
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;verifying-your-installation&quot;&gt;Verifying Your Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#verifying-your-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-check-that-the-containers-are-running&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Check that the containers are running&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-check-that-the-containers-are-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see your Kokoro Web container (and Traefik if you set it up) in the running containers list.&lt;/p&gt;&lt;h3 id=&quot;step-2-test-the-web-interface&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Test the web interface&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-test-the-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open a web browser and navigate to one of the following URLs:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;http://localhost:3000 (direct access)&lt;/li&gt;&lt;li&gt;http://kokoro.local (if you set up Pi-hole DNS or hosts file configuration)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You should see the Kokoro Web interface where you can test voice generation.&lt;/p&gt;&lt;h3 id=&quot;step-3-test-the-api&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Test the API&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-test-the-api&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You can test the API using curl:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -X POST &amp;quot;http://localhost:3000/api/v1/audio/speech&amp;quot; \
  -H &amp;quot;Content-Type: application/json&amp;quot; \
  -H &amp;quot;Authorization: Bearer your-api-key&amp;quot; \
  -d &amp;#39;{
    &amp;quot;model&amp;quot;: &amp;quot;model_q8f16&amp;quot;,
    &amp;quot;voice&amp;quot;: &amp;quot;af_bella&amp;quot;,
    &amp;quot;input&amp;quot;: &amp;quot;Hello, I am testing Kokoro Web API!&amp;quot;,
    &amp;quot;response_format&amp;quot;: &amp;quot;mp3&amp;quot;
  }&amp;#39; \
  --output test.mp3
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Play the generated audio (requires an audio player like mpg123)
mpg123 test.mp3
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;maintenance-and-updates&quot;&gt;Maintenance and Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-and-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-kokoro-web&quot;&gt;Updating Kokoro Web&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-kokoro-web&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update to the latest version of Kokoro Web:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Navigate to your Kokoro Web directory
cd ~/docker_data/kokoro-web

# Pull the latest image
docker compose pull

# Restart the container with the new image
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;backing-up-your-configuration&quot;&gt;Backing up your configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#backing-up-your-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;It&amp;#39;s good practice to back up your configuration files:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a backup directory
mkdir -p ~/backups/kokoro-web

# Copy configuration files
cp ~/docker_data/kokoro-web/docker-compose.yml ~/backups/kokoro-web/
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring-and-logs&quot;&gt;Monitoring and logs&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-and-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Monitor the logs for any issues:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# View real-time logs
docker logs -f kokoro-web

# View the last 100 lines of logs
docker logs --tail 100 kokoro-web
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;container-fails-to-start&quot;&gt;Container fails to start&lt;a class=&quot;h-anchor&quot; href=&quot;#container-fails-to-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the container fails to start, check the logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs kokoro-web
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Common issues include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Permission problems with the cache directory&lt;/li&gt;&lt;li&gt;Port 3000 already in use by another service&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;unable-to-access-web-interface&quot;&gt;Unable to access web interface&lt;a class=&quot;h-anchor&quot; href=&quot;#unable-to-access-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you can&amp;#39;t access the web interface:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Verify the container is running: &lt;code&gt;docker ps&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check if the port is correctly published: &lt;code&gt;docker port kokoro-web&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Try accessing with the IP address instead of localhost&lt;/li&gt;&lt;li&gt;Check your firewall settings: &lt;code&gt;sudo ufw status&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;api-authentication-issues&quot;&gt;API authentication issues&lt;a class=&quot;h-anchor&quot; href=&quot;#api-authentication-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you&amp;#39;re having trouble with API authentication:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Verify you&amp;#39;re using the correct API key&lt;/li&gt;&lt;li&gt;Check that the API key is correctly set in your docker-compose.yml&lt;/li&gt;&lt;li&gt;Ensure the Authorization header format is correct: &lt;code&gt;Authorization: Bearer your-api-key&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;security-best-practices&quot;&gt;Security Best Practices&lt;a class=&quot;h-anchor&quot; href=&quot;#security-best-practices&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;container-security&quot;&gt;Container security&lt;a class=&quot;h-anchor&quot; href=&quot;#container-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Keep Docker and the container image updated&lt;/li&gt;&lt;li&gt;Use specific image version tags instead of &amp;quot;latest&amp;quot; for production&lt;/li&gt;&lt;li&gt;Don&amp;#39;t run containers with elevated privileges&lt;/li&gt;&lt;li&gt;Use non-root users inside containers when possible&lt;/li&gt;&lt;li&gt;Limit container capabilities to only what&amp;#39;s needed&lt;a href=&quot;https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html&quot;&gt;^9&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;network-security&quot;&gt;Network security&lt;a class=&quot;h-anchor&quot; href=&quot;#network-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Use a reverse proxy like Traefik or Nginx for TLS termination&lt;/li&gt;&lt;li&gt;Consider using internal Docker networks for service isolation&lt;/li&gt;&lt;li&gt;Implement rate limiting for the API endpoints&lt;/li&gt;&lt;li&gt;Use firewalls to restrict access to your server&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;api-security&quot;&gt;API security&lt;a class=&quot;h-anchor&quot; href=&quot;#api-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Use a strong, randomly generated API key&lt;/li&gt;&lt;li&gt;Rotate API keys periodically&lt;/li&gt;&lt;li&gt;Implement IP-based restrictions if possible&lt;/li&gt;&lt;li&gt;Monitor API usage for unusual patterns&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You&amp;#39;ve now successfully set up Kokoro Web, a powerful open-source AI text-to-speech solution, on your Ubuntu system using Docker. This setup allows you to generate high-quality voice content locally without relying on external services, while maintaining compatibility with the OpenAI API format for easy integration with existing applications.&lt;/p&gt;&lt;p&gt;By following the additional configuration steps, you&amp;#39;ve also learned how to make Kokoro Web accessible through WSL for Windows users and how to integrate it with Pi-hole for convenient local domain access. The security recommendations will help protect your instance from unauthorized access.&lt;/p&gt;&lt;p&gt;As an open-source project, Kokoro Web continues to evolve, so be sure to check the official repository periodically for updates and new features. With this self-hosted solution, you have complete control over your text-to-speech processing, ensuring privacy and flexibility for your projects.&lt;/p&gt;&lt;p&gt;⁂&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Installing Metabase on Ubuntu via WSL2 with Docker: A Complete Guide for Beginners (Enterprise setup)</title><link>https://diylabhub.com/installing-metabase-on-ubuntu-via-wsl2-with-docker-a-complete-guide-for-beginners-enterprise-setup/</link><guid isPermaLink="true">https://diylabhub.com/installing-metabase-on-ubuntu-via-wsl2-with-docker-a-complete-guide-for-beginners-enterprise-setup/</guid><pubDate>Thu, 03 Apr 2025 04:08:00 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Metabase is a powerful, open-source business intelligence tool that lets you visualize and explore your data without needing to write SQL code. This guide shows you how to install Metabase on Windows using WSL2 (Windows Subsystem for Linux) with Docker, providing:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Easy access through Windows while leveraging Linux&amp;#39;s container optimization&lt;/li&gt;&lt;li&gt;Enterprise-grade security and stability features&lt;/li&gt;&lt;li&gt;Simple setup for powerful data visualization&lt;/li&gt;&lt;li&gt;Persistent data storage that survives restarts&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: This method is perfect for data analysts who work on Windows machines but want the power of Linux containers.&lt;/p&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before starting, make sure you have:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Windows 10/11&lt;/strong&gt; (Build 19041 or newer)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;4GB RAM&lt;/strong&gt; minimum (8GB recommended for smooth performance)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Virtualization enabled&lt;/strong&gt; in your BIOS/UEFI settings&lt;ul&gt;&lt;li&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Most computers have this enabled by default. If not, you&amp;#39;ll need to restart and press F2, F10, or Del during startup to enter BIOS settings.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Administrator access on your Windows machine&lt;/li&gt;&lt;li&gt;At least 10GB free disk space&lt;/li&gt;&lt;li&gt;Internet connection to download packages&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;1-setting-up-wsl2&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Setting Up WSL2&lt;a class=&quot;h-anchor&quot; href=&quot;#1-setting-up-wsl2&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;install-wsl2-with-ubuntu&quot;&gt;Install WSL2 with Ubuntu&lt;a class=&quot;h-anchor&quot; href=&quot;#install-wsl2-with-ubuntu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;wsl --set-default-version 2
wsl --install -d Ubuntu
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Ubuntu on WSL2. Your computer will restart automatically after installation.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: If you see any error about virtualization, you need to enable it in your BIOS settings.&lt;/p&gt;&lt;h3 id=&quot;verify-wsl2-installation&quot;&gt;Verify WSL2 Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#verify-wsl2-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;wsl -l -v
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see &amp;quot;Ubuntu&amp;quot; with &amp;quot;2&amp;quot; in the VERSION column. If it shows &amp;quot;1&amp;quot;, convert it with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;wsl --set-version Ubuntu 2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;HINT&lt;/strong&gt;: If Ubuntu isn&amp;#39;t running, type &lt;code&gt;wsl&lt;/code&gt; in PowerShell to start it.&lt;/p&gt;&lt;h2 id=&quot;2-installing-docker-engine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Installing Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#2-installing-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;update-package-information&quot;&gt;Update Package Information&lt;a class=&quot;h-anchor&quot; href=&quot;#update-package-information&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install ca-certificates curl gnupg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This prepares your system with necessary certificates and tools.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: When asked for your password, you won&amp;#39;t see anything as you type - this is normal!&lt;/p&gt;&lt;h3 id=&quot;set-up-docker-repository&quot;&gt;Set Up Docker Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands download and set up Docker&amp;#39;s security keys.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;HINT&lt;/strong&gt;: You might see a message about &amp;quot;Creating directory&amp;quot; - this is expected and means it&amp;#39;s working correctly.&lt;/p&gt;&lt;h3 id=&quot;add-docker-repository-to-apt-sources&quot;&gt;Add Docker Repository to APT Sources&lt;a class=&quot;h-anchor&quot; href=&quot;#add-docker-repository-to-apt-sources&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;$VERSION_CODENAME&amp;quot;) stable&amp;quot; | \
sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds Docker&amp;#39;s official repository to your system.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Stick to official repositories for security and stability.&lt;/p&gt;&lt;h3 id=&quot;install-docker-components&quot;&gt;Install Docker Components&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-components&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Docker Engine and all necessary components.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;HINT&lt;/strong&gt;: This might take a few minutes depending on your internet speed.&lt;/p&gt;&lt;h3 id=&quot;set-docker-permissions&quot;&gt;Set Docker Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#set-docker-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER &amp;amp;&amp;amp; newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This lets you run Docker commands without typing sudo each time.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: If you close your terminal, you might need to restart it for these permissions to take effect.&lt;/p&gt;&lt;h3 id=&quot;test-docker-installation&quot;&gt;Test Docker Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#test-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see a &amp;quot;Hello from Docker!&amp;quot; message which confirms Docker is working correctly.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TROUBLESHOOTING&lt;/strong&gt;: If you see &amp;quot;permission denied&amp;quot;, try logging out and back in to WSL, or restart your computer.&lt;/p&gt;&lt;h2 id=&quot;3-setting-up-metabase&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Setting Up Metabase&lt;a class=&quot;h-anchor&quot; href=&quot;#3-setting-up-metabase&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;create-directory-structure&quot;&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/metabase/{data,config,postgres}
chmod -R 755 ~/docker_data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates folders to store your Metabase data persistently.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: These directories will remain even if Metabase is uninstalled, protecting your data.&lt;/p&gt;&lt;h3 id=&quot;create-docker-compose-file&quot;&gt;Create Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#create-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/metabase/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  metabase:
    image: metabase/metabase:latest
    container_name: metabase
    depends_on:
      - postgres
    environment:
      - MB_DB_TYPE=postgres
      - MB_DB_DBNAME=metabase
      - MB_DB_PORT=5432
      - MB_DB_USER=metabase
      - MB_DB_PASS=SecurePass123!
      - MB_DB_HOST=postgres
      - JAVA_TIMEZONE=US/Pacific
    volumes:
      - ./data:/metabase-data
    ports:
      - 3000:3000
    restart: unless-stopped

  postgres:
    image: postgres:14
    container_name: metabase-postgres
    environment:
      - POSTGRES_USER=metabase
      - POSTGRES_PASSWORD=SecurePass123!
      - POSTGRES_DB=metabase
    volumes:
      - ./postgres:/var/lib/postgresql/data
    restart: unless-stopped
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates the configuration file for Metabase and its database.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;SECURITY TIP&lt;/strong&gt;: Change &lt;code&gt;SecurePass123!&lt;/code&gt; to your own password before proceeding.&lt;/p&gt;&lt;h3 id=&quot;start-metabase&quot;&gt;Start Metabase&lt;a class=&quot;h-anchor&quot; href=&quot;#start-metabase&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/metabase &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts Metabase and PostgreSQL containers in the background.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: The first start might take 2-3 minutes as Docker downloads the images.&lt;/p&gt;&lt;h3 id=&quot;check-container-status&quot;&gt;Check Container Status&lt;a class=&quot;h-anchor&quot; href=&quot;#check-container-status&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify both containers are running. You should see &amp;quot;metabase&amp;quot; and &amp;quot;metabase-postgres&amp;quot; listed with &amp;quot;Up&amp;quot; status.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TROUBLESHOOTING&lt;/strong&gt;: If containers aren&amp;#39;t running, check logs with &lt;code&gt;docker logs metabase&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;4-accessing-metabase&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Accessing Metabase&lt;a class=&quot;h-anchor&quot; href=&quot;#4-accessing-metabase&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;from-wsl2-ubuntu&quot;&gt;From WSL2 Ubuntu&lt;a class=&quot;h-anchor&quot; href=&quot;#from-wsl2-ubuntu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://localhost:3000
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: If this doesn&amp;#39;t work, try the Windows Host method below.&lt;/p&gt;&lt;h3 id=&quot;from-windows-host&quot;&gt;From Windows Host&lt;a class=&quot;h-anchor&quot; href=&quot;#from-windows-host&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you can&amp;#39;t access Metabase from Windows, run this in PowerShell (as Administrator):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=$(wsl hostname -I | awk &amp;#39;{print $1}&amp;#39;)
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This forwards Windows port 3000 to the WSL2 port.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;HINT&lt;/strong&gt;: You might need to run this command again if you restart your computer.&lt;/p&gt;&lt;h2 id=&quot;5-initial-metabase-setup&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Initial Metabase Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#5-initial-metabase-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When you first access Metabase at http://localhost:3000, you&amp;#39;ll need to:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create an admin account (remember these credentials!)&lt;/li&gt;&lt;li&gt;Set your organization name&lt;/li&gt;&lt;li&gt;Connect to your data sources (you can skip this and do it later)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Use a strong password for your admin account that you can remember.&lt;/p&gt;&lt;h2 id=&quot;6-backing-up-your-data&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Backing Up Your Data&lt;a class=&quot;h-anchor&quot; href=&quot;#6-backing-up-your-data&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;create-backup-script&quot;&gt;Create Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#create-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/metabase/backup.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=~/metabase_backups/$(date +%Y%m%d)
mkdir -p $BACKUP_DIR

# Backup PostgreSQL database
docker exec metabase-postgres pg_dump -U metabase metabase &amp;gt; $BACKUP_DIR/metabase.sql

# Backup H2 database files if they exist
cp ~/docker_data/metabase/data/*.db $BACKUP_DIR/ 2&amp;gt;/dev/null || echo &amp;quot;No H2 database files found&amp;quot;

echo &amp;quot;Backup completed to $BACKUP_DIR&amp;quot;
EOF
chmod +x ~/docker_data/metabase/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a backup script for your Metabase data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Run this backup before any updates or changes to your system.&lt;/p&gt;&lt;h3 id=&quot;run-backup-manually&quot;&gt;Run Backup Manually&lt;a class=&quot;h-anchor&quot; href=&quot;#run-backup-manually&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;~/docker_data/metabase/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a backup in the ~/metabase_backups folder.&lt;/p&gt;&lt;h3 id=&quot;schedule-automatic-backups&quot;&gt;Schedule Automatic Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#schedule-automatic-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * ~/docker_data/metabase/backup.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up daily backups at 2:00 AM.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;HINT&lt;/strong&gt;: You can check if it&amp;#39;s scheduled with &lt;code&gt;crontab -l&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;7-updating-metabase&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Updating Metabase&lt;a class=&quot;h-anchor&quot; href=&quot;#7-updating-metabase&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;safe-update-procedure&quot;&gt;Safe Update Procedure&lt;a class=&quot;h-anchor&quot; href=&quot;#safe-update-procedure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/metabase &amp;amp;&amp;amp; \
docker compose pull &amp;amp;&amp;amp; \
docker compose down --timeout 120 &amp;amp;&amp;amp; \
docker compose up -d --build
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates Metabase to the latest version while preserving your data.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Always run a backup before updating!&lt;/p&gt;&lt;h2 id=&quot;8-troubleshooting&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#8-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;check-logs&quot;&gt;Check Logs&lt;a class=&quot;h-anchor&quot; href=&quot;#check-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs metabase
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;View Metabase logs to identify issues.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Add &lt;code&gt;--tail 100&lt;/code&gt; to see just the last 100 lines: &lt;code&gt;docker logs --tail 100 metabase&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;database-connection-issues&quot;&gt;Database Connection Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#database-connection-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Metabase can&amp;#39;t connect to PostgreSQL:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec metabase nc -zv postgres 5432
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This tests if Metabase can reach the database. You should see &amp;quot;Connection to postgres 5432 port succeeded!&amp;quot;&lt;/p&gt;&lt;h3 id=&quot;reset-admin-password&quot;&gt;Reset Admin Password&lt;a class=&quot;h-anchor&quot; href=&quot;#reset-admin-password&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you forget your admin password:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -it --rm \
  -e MB_DB_TYPE=postgres \
  -e MB_DB_DBNAME=metabase \
  -e MB_DB_HOST=postgres \
  -e MB_DB_USER=metabase \
  -e MB_DB_PASS=SecurePass123! \
  --network container:metabase \
  metabase/metabase \
  java -jar /app/metabase.jar reset-password admin@example.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;quot;admin@example.com&amp;quot; with your admin email. You&amp;#39;ll get a password reset link in the console.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Copy the entire password reset URL - it&amp;#39;s very long!&lt;/p&gt;&lt;h3 id=&quot;wsl2-network-issues-after-restart&quot;&gt;WSL2 Network Issues After Restart&lt;a class=&quot;h-anchor&quot; href=&quot;#wsl2-network-issues-after-restart&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you can&amp;#39;t access Metabase after restarting your computer:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=0.0.0.0
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=$(wsl hostname -I | awk &amp;#39;{print $1}&amp;#39;)
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This resets the port forwarding from Windows to WSL2.&lt;/p&gt;&lt;h2 id=&quot;9-performance-monitoring&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Performance Monitoring&lt;a class=&quot;h-anchor&quot; href=&quot;#9-performance-monitoring&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;check-resource-usage&quot;&gt;Check Resource Usage&lt;a class=&quot;h-anchor&quot; href=&quot;#check-resource-usage&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stats metabase
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows real-time CPU, memory, and network usage of your Metabase container.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Press Ctrl+C to exit the stats view.&lt;/p&gt;&lt;h3 id=&quot;generate-system-diagnostics&quot;&gt;Generate System Diagnostics&lt;a class=&quot;h-anchor&quot; href=&quot;#generate-system-diagnostics&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec metabase java -jar /app/metabase.jar diagnose
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a detailed report about Metabase&amp;#39;s health and performance.&lt;/p&gt;&lt;h2 id=&quot;10-known-issues-2025&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Known Issues (2025)&lt;a class=&quot;h-anchor&quot; href=&quot;#10-known-issues-2025&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;ARM64 Compatibility Issues&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Symptom&lt;/strong&gt;: Errors on ARM-based Windows machines&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fix&lt;/strong&gt;: Add &lt;code&gt;--platform=linux/amd64&lt;/code&gt; to Docker commands&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Memory Leaks with JDK 21&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Symptom&lt;/strong&gt;: Metabase slows down after running for several days&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fix&lt;/strong&gt;: Add this environment variable to the metabase service in docker-compose.yml: &lt;code&gt;- JAVA_TOOL_OPTIONS=-XX:+UseZGC&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;WSL2 Port Forwarding After Sleep/Hibernate&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Symptom&lt;/strong&gt;: Can&amp;#39;t access Metabase after computer wakes up&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fix&lt;/strong&gt;: Re-run the netsh commands from section 8&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Keep your Windows and WSL2 updated to minimize these issues.&lt;/p&gt;&lt;h2 id=&quot;11-security-hardening-optional&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Security Hardening (Optional)&lt;a class=&quot;h-anchor&quot; href=&quot;#11-security-hardening-optional&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;run-docker-security-benchmark&quot;&gt;Run Docker Security Benchmark&lt;a class=&quot;h-anchor&quot; href=&quot;#run-docker-security-benchmark&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -it --rm \
  -v /var/run/docker.sock:/var/run/docker.sock \
  docker/docker-bench-security
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This checks your Docker installation for security best practices.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;TIP&lt;/strong&gt;: Don&amp;#39;t worry about all warnings - focus on the &amp;quot;high&amp;quot; severity items first.&lt;/p&gt;&lt;h2 id=&quot;12-uninstalling-metabase&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Uninstalling Metabase&lt;a class=&quot;h-anchor&quot; href=&quot;#12-uninstalling-metabase&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you need to remove Metabase:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/metabase &amp;amp;&amp;amp; docker compose down
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This stops and removes containers but keeps your data. To remove everything:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/metabase &amp;amp;&amp;amp; docker compose down -v &amp;amp;&amp;amp; cd ~ &amp;amp;&amp;amp; rm -rf ~/docker_data/metabase
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: This permanently deletes all your Metabase data!&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a production-ready Metabase installation running on Windows via WSL2 and Docker. This setup gives you the best of both worlds: Windows convenience with Linux&amp;#39;s container optimization.&lt;/p&gt;&lt;p&gt;If you need just the basics, you can stop after section 5. For production use, we recommend completing all sections through section 7.&lt;/p&gt;&lt;p&gt;Remember to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Back up your data regularly&lt;/li&gt;&lt;li&gt;Check for updates monthly&lt;/li&gt;&lt;li&gt;Monitor your system resources if you notice slowdowns&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;For more information, visit the &lt;a href=&quot;https://www.metabase.com/docs/latest/&quot;&gt;official Metabase documentation&lt;/a&gt;.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing Huginn: Self-Hosted Automation Platform</title><link>https://diylabhub.com/complete-guide-to-installing-huginn-self-hosted-automation-platform/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-huginn-self-hosted-automation-platform/</guid><pubDate>Wed, 02 Apr 2025 19:56:58 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Huginn is a powerful open-source automation platform that works like IFTTT but gives you complete control over your data and workflows. By hosting it yourself using Docker, you can create custom automation agents for tasks like monitoring websites, sending notifications, and processing data without sharing your information with third-party services.&lt;/p&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;software-you-need&quot;&gt;Software You Need&lt;a class=&quot;h-anchor&quot; href=&quot;#software-you-need&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Docker Engine version 24.0 or newer&lt;/li&gt;&lt;li&gt;Docker Compose version 2.20 or newer&lt;/li&gt;&lt;li&gt;Linux Server (Ubuntu 22.04 LTS recommended)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Minimum Setup&lt;/strong&gt;: 2 CPU cores, 4GB RAM, 20GB storage&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Better Performance&lt;/strong&gt;: 4 CPU cores, 8GB RAM, 50GB SSD storage&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-settings&quot;&gt;Network Settings&lt;a class=&quot;h-anchor&quot; href=&quot;#network-settings&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;You&amp;#39;ll need port 3000 open for Huginn&amp;#39;s web interface&lt;/li&gt;&lt;li&gt;A domain name pointing to your server (like huginn.yourdomain.com)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;user-permissions&quot;&gt;User Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#user-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;A non-root user with sudo privileges&lt;/li&gt;&lt;li&gt;Your user added to the Docker group&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;basic-installation-stop-here-for-minimal-setup&quot;&gt;Basic Installation (Stop Here for Minimal Setup)&lt;a class=&quot;h-anchor&quot; href=&quot;#basic-installation-stop-here-for-minimal-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-create-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/huginn/{data,config,logs}
chmod -R 775 ~/docker_data/huginn
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates folders to store Huginn&amp;#39;s data permanently.&lt;/p&gt;&lt;h3 id=&quot;step-2-create-docker-compose-file&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/huginn/docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Copy and paste this configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3&amp;#39;

services:
  huginn:
    image: huginn/huginn:latest
    container_name: huginn
    restart: unless-stopped
    ports:
      - &amp;quot;3000:3000&amp;quot;
    environment:
      - HUGINN_DATABASE_NAME=huginn
      - HUGINN_DATABASE_USERNAME=huginn
      - HUGINN_DATABASE_PASSWORD=huginnpassword
      - INVITATION_CODE=welcome
    volumes:
      - ~/docker_data/huginn/data:/var/lib/mysql
      - ~/docker_data/huginn/config:/app/config
      - ~/docker_data/huginn/logs:/app/log
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up a basic Huginn container with MySQL database.&lt;/p&gt;&lt;h3 id=&quot;step-3-start-huginn&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Huginn&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-start-huginn&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/huginn
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts Huginn in the background. The first launch might take a few minutes.&lt;/p&gt;&lt;h3 id=&quot;step-4-check-if-huginn-is-running&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Check if Huginn is Running&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-check-if-huginn-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep huginn
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the huginn container running.&lt;/p&gt;&lt;h3 id=&quot;step-5-access-huginn&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access Huginn&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-access-huginn&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your web browser and go to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://your-server-ip:3000
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Sign in with these default credentials:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Username: admin&lt;/li&gt;&lt;li&gt;Password: password&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Change your password immediately by clicking on your username in the top right corner and selecting &amp;quot;Account&amp;quot;.&lt;/p&gt;&lt;h2 id=&quot;advanced-setup-continue-for-production-environment&quot;&gt;Advanced Setup (Continue for Production Environment)&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-setup-continue-for-production-environment&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;integrating-with-traefik-for-secure-access&quot;&gt;Integrating with Traefik for Secure Access&lt;a class=&quot;h-anchor&quot; href=&quot;#integrating-with-traefik-for-secure-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;step-1-create-a-network-for-traefik&quot;&gt;Step 1: Create a Network for Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-network-for-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker network create proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a shared network for Traefik and Huginn.&lt;/p&gt;&lt;h4 id=&quot;step-2-update-docker-compose-with-traefik-labels&quot;&gt;Step 2: Update Docker Compose with Traefik Labels&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-update-docker-compose-with-traefik-labels&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Replace your docker-compose.yml with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3&amp;#39;

services:
  huginn:
    image: huginn/huginn:latest
    container_name: huginn
    restart: unless-stopped
    environment:
      - HUGINN_DATABASE_NAME=huginn
      - HUGINN_DATABASE_USERNAME=huginn
      - HUGINN_DATABASE_PASSWORD=huginnpassword
      - INVITATION_CODE=welcome
    volumes:
      - ~/docker_data/huginn/data:/var/lib/mysql
      - ~/docker_data/huginn/config:/app/config
      - ~/docker_data/huginn/logs:/app/log
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.huginn.rule=Host(`huginn.yourdomain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.huginn.entrypoints=websecure&amp;quot;
      - &amp;quot;traefik.http.routers.huginn.tls=true&amp;quot;
      - &amp;quot;traefik.http.services.huginn.loadbalancer.server.port=3000&amp;quot;

networks:
  proxy:
    external: true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Remember to change &lt;code&gt;huginn.yourdomain.com&lt;/code&gt; to your actual domain.&lt;/p&gt;&lt;h4 id=&quot;step-3-restart-huginn-with-new-configuration&quot;&gt;Step 3: Restart Huginn with New Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-restart-huginn-with-new-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/huginn
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This applies the new configuration with Traefik integration.&lt;/p&gt;&lt;h2 id=&quot;security-hardening&quot;&gt;Security Hardening&lt;a class=&quot;h-anchor&quot; href=&quot;#security-hardening&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;update-default-credentials&quot;&gt;Update Default Credentials&lt;a class=&quot;h-anchor&quot; href=&quot;#update-default-credentials&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it huginn rails runner &amp;quot;User.first.update(password: &amp;#39;your-secure-password&amp;#39;)&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This changes the default admin password. Replace &amp;#39;your-secure-password&amp;#39; with a strong password.&lt;/p&gt;&lt;h3 id=&quot;restrict-network-access&quot;&gt;Restrict Network Access&lt;a class=&quot;h-anchor&quot; href=&quot;#restrict-network-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow proto tcp from 192.168.1.0/24 to any port 3000
sudo ufw deny 3000
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows access only from your local network. Change 192.168.1.0/24 to match your network.&lt;/p&gt;&lt;h2 id=&quot;data-management&quot;&gt;Data Management&lt;a class=&quot;h-anchor&quot; href=&quot;#data-management&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;setting-up-automatic-backups&quot;&gt;Setting Up Automatic Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-automatic-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;step-1-create-a-backup-script&quot;&gt;Step 1: Create a Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/huginn/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Copy and paste:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
BACKUP_DIR=~/docker_data/huginn/backups
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
docker exec huginn mysqldump -u root huginn &amp;gt; $BACKUP_DIR/huginn_$TIMESTAMP.sql
tar -czvf $BACKUP_DIR/huginn_config_$TIMESTAMP.tar.gz ~/docker_data/huginn/config
echo &amp;quot;Backup completed: $BACKUP_DIR/huginn_$TIMESTAMP.sql&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-2-make-the-script-executable&quot;&gt;Step 2: Make the Script Executable&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-make-the-script-executable&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;chmod +x ~/docker_data/huginn/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;step-3-schedule-daily-backups&quot;&gt;Step 3: Schedule Daily Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-schedule-daily-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l ; echo &amp;quot;0 2 * * * ~/docker_data/huginn/backup.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up a backup job to run every day at 2 AM.&lt;/p&gt;&lt;h2 id=&quot;common-issues-and-solutions&quot;&gt;Common Issues and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;problem-database-connection-errors&quot;&gt;Problem: Database Connection Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-database-connection-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you see &amp;quot;Could not connect to database&amp;quot; errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker restart huginn
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Wait 30 seconds and try accessing Huginn again.&lt;/p&gt;&lt;h3 id=&quot;problem-permission-errors-on-data-directory&quot;&gt;Problem: Permission Errors on Data Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-permission-errors-on-data-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Huginn can&amp;#39;t write to data directories:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R 1001:1001 ~/docker_data/huginn
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This fixes ownership issues with the data directories.&lt;/p&gt;&lt;h3 id=&quot;problem-email-not-sending&quot;&gt;Problem: Email Not Sending&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-email-not-sending&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To configure email for notifications:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/huginn/docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add these environment variables:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;environment:
  - SMTP_DOMAIN=yourdomain.com
  - SMTP_USER_NAME=your_email@yourdomain.com
  - SMTP_PASSWORD=your_email_password
  - SMTP_SERVER=smtp.yourdomain.com
  - SMTP_PORT=587
  - SMTP_AUTHENTICATION=plain
  - SMTP_ENABLE_STARTTLS_AUTO=true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Then restart Huginn:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;upgrading-huginn&quot;&gt;Upgrading Huginn&lt;a class=&quot;h-anchor&quot; href=&quot;#upgrading-huginn&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-pull-latest-image&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Pull Latest Image&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-pull-latest-image&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/huginn
docker compose pull
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads the latest Huginn version.&lt;/p&gt;&lt;h3 id=&quot;step-2-apply-the-update&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Apply the Update&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-apply-the-update&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This restarts Huginn with the new version.&lt;/p&gt;&lt;h3 id=&quot;step-3-run-database-migrations&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Run Database Migrations&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-run-database-migrations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec huginn bundle exec rake db:migrate
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates the database structure if needed.&lt;/p&gt;&lt;h2 id=&quot;monitoring-your-huginn-installation&quot;&gt;Monitoring Your Huginn Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-your-huginn-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;check-container-logs&quot;&gt;Check Container Logs&lt;a class=&quot;h-anchor&quot; href=&quot;#check-container-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs -f huginn
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Press Ctrl+C to exit the log view.&lt;/p&gt;&lt;h3 id=&quot;check-container-health&quot;&gt;Check Container Health&lt;a class=&quot;h-anchor&quot; href=&quot;#check-container-health&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker inspect --format=&amp;quot;{{.State.Health.Status}}&amp;quot; huginn
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows if the container is healthy.&lt;/p&gt;&lt;h2 id=&quot;creating-your-first-agent&quot;&gt;Creating Your First Agent&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-your-first-agent&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Log in to Huginn&lt;/li&gt;&lt;li&gt;Click &amp;quot;Agents&amp;quot; in the top menu&lt;/li&gt;&lt;li&gt;Click &amp;quot;New Agent&amp;quot; button&lt;/li&gt;&lt;li&gt;Select &amp;quot;Website Agent&amp;quot; from the dropdown&lt;/li&gt;&lt;li&gt;Fill in the required fields:&lt;ul&gt;&lt;li&gt;Name: &amp;quot;Website Monitor&amp;quot;&lt;/li&gt;&lt;li&gt;Schedule: &amp;quot;every_15m&amp;quot; (checks every 15 minutes)&lt;/li&gt;&lt;li&gt;URL: the website you want to monitor&lt;/li&gt;&lt;li&gt;Type: &amp;quot;html&amp;quot;&lt;/li&gt;&lt;li&gt;Extract: Add what data you want to extract&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Click &amp;quot;Save&amp;quot; to create your agent&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a working Huginn installation that you can use to create powerful automation workflows. Start with simple agents and gradually build more complex scenarios as you become familiar with the system.&lt;/p&gt;&lt;p&gt;For more advanced configurations and agent examples, visit the official Huginn documentation at https://github.com/huginn/huginn/wiki&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide to Installing AccVideo: Accelerating Video Diffusion Models</title><link>https://diylabhub.com/comprehensive-guide-to-installing-accvideo-accelerating-video-diffusion-models/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-installing-accvideo-accelerating-video-diffusion-models/</guid><pubDate>Mon, 31 Mar 2025 17:55:23 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;AccVideo is an innovative open-source framework designed to accelerate video diffusion models through efficient distillation techniques using synthetic datasets. Developed by aejion and available on GitHub, this tool leverages PyTorch to optimize the training and inference processes for video generation tasks. This guide provides detailed installation instructions for Ubuntu, Windows, and Docker environments, adhering to best practices for security, data persistence, and maintainability.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;CPU&lt;/strong&gt;: x86_64/AMD64 or ARM64 architecture (4+ cores recommended)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;RAM&lt;/strong&gt;: 8GB minimum (16GB+ for large-scale training)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GPU&lt;/strong&gt;: NVIDIA GPU with 8GB+ VRAM (RTX 3080 or equivalent recommended)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Storage&lt;/strong&gt;: 50GB+ free space (NVMe SSD preferred for dataset handling)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Ubuntu&lt;/strong&gt;: 22.04 LTS or 20.04 LTS&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Windows&lt;/strong&gt;: Windows 10/11 with WSL2 enabled&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Docker&lt;/strong&gt;: 24.0+ with Compose Plugin v2.21+&lt;/li&gt;&lt;li&gt;&lt;strong&gt;NVIDIA Drivers&lt;/strong&gt;: 535+ with CUDA 12.2 toolkit&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Python&lt;/strong&gt;: 3.10+ with pip package manager&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Minimum 10Mbps internet connection for model downloads&lt;/li&gt;&lt;li&gt;Open ports 8000-8010 for local development&lt;/li&gt;&lt;li&gt;HTTPS access to PyPI and GitHub repositories&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;ubuntu-installation&quot;&gt;Ubuntu Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#ubuntu-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-system-preparation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;System Preparation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-system-preparation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
sudo apt install -y build-essential cmake ninja-build git libssl-dev python3-dev python3-venv
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Potential Issues&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Missing &lt;code&gt;lsb_release&lt;/code&gt;:&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;  sudo apt install -y lsb-release
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-cuda-toolkit-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;CUDA Toolkit Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-cuda-toolkit-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda-repo-ubuntu2204-12-2-local_12.2.2-535.104.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-2-local_12.2.2-535.104.05-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-2-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nvidia-smi
nvcc --version
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-python-environment-setup&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Python Environment Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-python-environment-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;python3 -m venv accvideo-env
source accvideo-env/bin/activate
pip install --upgrade pip setuptools wheel
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-clone-and-install-accvideo&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Clone and Install AccVideo&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-clone-and-install-accvideo&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;git clone https://github.com/aejion/AccVideo.git
cd AccVideo
pip install -r requirements.txt
pip install -e .
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Verification&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;python -c &amp;quot;import accvideo; print(accvideo.__version__)&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;windows-installation-via-wsl2&quot;&gt;Windows Installation via WSL2&lt;a class=&quot;h-anchor&quot; href=&quot;#windows-installation-via-wsl2&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-enable-wsl2&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enable WSL2&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-enable-wsl2&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;wsl --install -d Ubuntu-22.04
wsl --set-version Ubuntu-22.04 2
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-nvidia-cuda-setup&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;NVIDIA CUDA Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-nvidia-cuda-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -O https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/3bf863cc.pub
sudo add-apt-repository &amp;quot;deb https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/ /&amp;quot;
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-2
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-python-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Python Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-python-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt install -y python3.10 python3.10-venv
python3.10 -m venv accvideo-env
source accvideo-env/bin/activate
pip install torch==2.1.0+cu121 -f https://download.pytorch.org/whl/torch_stable.html
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;docker-installation-with-traefik&quot;&gt;Docker Installation with Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-installation-with-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/accvideo/{models,config}
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-docker-composeyml&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;docker-compose.yml&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-docker-composeyml&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;version: &amp;#39;3.8&amp;#39;
services:
  accvideo:
    image: pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
    restart: unless-stopped
    command: bash -c &amp;quot;git clone https://github.com/aejion/AccVideo.git &amp;amp;&amp;amp; cd AccVideo &amp;amp;&amp;amp; pip install -r requirements.txt &amp;amp;&amp;amp; python app.py&amp;quot;
    volumes:
      - ~/docker_data/accvideo/models:/workspace/models
      - ~/docker_data/accvideo/config:/workspace/config
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.accvideo.rule=Host(`accvideo.yourdomain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.accvideo.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.accvideo.tls.certresolver=leresolver&amp;quot;
      - &amp;quot;traefik.http.services.accvideo.loadbalancer.server.port=8000&amp;quot;

networks:
  proxy:
    external: true
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-launch-container&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Launch Container&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-launch-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose -f ~/docker_data/accvideo/docker-compose.yml up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;configuration&quot;&gt;Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;model-parameters&quot;&gt;Model Parameters&lt;a class=&quot;h-anchor&quot; href=&quot;#model-parameters&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# config/training.yaml
diffusion:
  num_timesteps: 1000
  beta_schedule: &amp;quot;linear&amp;quot;
  loss_type: &amp;quot;hybrid&amp;quot;

distillation:
  teacher_model: &amp;quot;stabilityai/stable-diffusion-xl-base-1.0&amp;quot;
  student_model: &amp;quot;accvideo/sd-xl-distilled&amp;quot;
  temperature: 2.5
  kl_weight: 0.8
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;environment-variables&quot;&gt;Environment Variables&lt;a class=&quot;h-anchor&quot; href=&quot;#environment-variables&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;export ACCVIDEO_CACHE_DIR=&amp;quot;~/accvideo_cache&amp;quot;
export HF_HOME=&amp;quot;~/huggingface_cache&amp;quot;
export NVIDIA_VISIBLE_DEVICES=&amp;quot;all&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;least-privilege-execution&quot;&gt;Least Privilege Execution&lt;a class=&quot;h-anchor&quot; href=&quot;#least-privilege-execution&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo useradd -r -s /bin/false accvideo-user
sudo chown -R accvideo-user:accvideo-user ~/docker_data/accvideo
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;network-hardening&quot;&gt;Network Hardening&lt;a class=&quot;h-anchor&quot; href=&quot;#network-hardening&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo ufw allow proto tcp from 192.168.1.0/24 to any port 8000
sudo ufw deny out 25
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;data-persistence&quot;&gt;Data Persistence&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;backup-strategy&quot;&gt;Backup Strategy&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-strategy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Daily backup script
tar -czvf accvideo-$(date +%Y%m%d).tar.gz ~/docker_data/accvideo
rclone copy accvideo-*.tar.gz backup:accvideo/archives
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;volume-configuration&quot;&gt;Volume Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#volume-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;volumes:
  accvideo_models:
    driver: local
    driver_opts:
      type: nfs
      o: addr=192.168.1.100,rw
      device: &amp;quot;:/mnt/nas/accvideo/models&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;common-issues-and-solutions&quot;&gt;Common Issues and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;cuda-out-of-memory&quot;&gt;CUDA Out of Memory&lt;a class=&quot;h-anchor&quot; href=&quot;#cuda-out-of-memory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;# Add to training script
torch.cuda.empty_cache()
torch.backends.cudnn.benchmark = True
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;dependency-conflicts&quot;&gt;Dependency Conflicts&lt;a class=&quot;h-anchor&quot; href=&quot;#dependency-conflicts&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;python -m pip install --upgrade --force-reinstall --no-deps torch torchvision
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;model-updates&quot;&gt;Model Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#model-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose exec accvideo bash -c &amp;quot;cd AccVideo &amp;amp;&amp;amp; git pull origin main&amp;quot;
docker compose restart accvideo
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring&quot;&gt;Monitoring&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;watch -n 5 &amp;quot;nvidia-smi &amp;amp;&amp;amp; docker stats --no-stream&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;p&gt;This comprehensive guide provides multiple deployment options for AccVideo while emphasizing security and reproducibility. The Docker/Traefik integration enables production-grade deployments, while the native installations cater to development workflows. Regular monitoring of GPU utilization (≥85% during training) and VRAM allocation patterns is recommended for optimal performance.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Setting Up Awesome Self-Hosted Services with Docker on Ubuntu</title><link>https://diylabhub.com/complete-guide-to-setting-up-awesome-self-hosted-services-with-docker-on-ubuntu/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-setting-up-awesome-self-hosted-services-with-docker-on-ubuntu/</guid><pubDate>Fri, 21 Mar 2025 16:36:16 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;This comprehensive guide will walk you through setting up a self-hosted environment on Ubuntu 20.04 or newer using Docker. You&amp;#39;ll learn how to secure your services, access them via WSL, and configure local DNS with Pi-hole for seamless access across your network.&lt;/p&gt;&lt;p&gt;Before diving into the technical details, let&amp;#39;s understand what we&amp;#39;re building: a personal cloud infrastructure that gives you complete control over your data and services while maintaining security and ease of access.&lt;/p&gt;&lt;h2 id=&quot;introduction-self-hosting-with-docker&quot;&gt;Introduction: Self-Hosting with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-self-hosting-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Self-hosting allows you to run services on your own hardware instead of relying on third-party providers. Docker makes this process significantly easier by containerizing applications, ensuring consistency across environments, and simplifying deployment and updates.&lt;/p&gt;&lt;p&gt;Benefits of using Docker for self-hosting:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Isolation: Each service runs in its own container&lt;/li&gt;&lt;li&gt;Portability: Easy migration between hosts&lt;/li&gt;&lt;li&gt;Consistency: Reproducible environments&lt;/li&gt;&lt;li&gt;Security: Enhanced isolation compared to traditional installations&lt;/li&gt;&lt;li&gt;Simplified updates: Update services with minimal downtime&lt;/li&gt;&lt;li&gt;Resource efficiency: Lower overhead than virtual machines&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Awesome-Self-Hosted-Services.webp&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;A computer/server running Ubuntu 20.04 LTS or newer&lt;/li&gt;&lt;li&gt;Minimum 4GB RAM (8GB+ recommended for multiple services)&lt;/li&gt;&lt;li&gt;At least 50GB storage (SSD preferred)&lt;/li&gt;&lt;li&gt;Stable network connection&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;softwarenetwork-requirements&quot;&gt;Software/Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#softwarenetwork-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer (server or desktop edition)&lt;/li&gt;&lt;li&gt;sudo privileges&lt;/li&gt;&lt;li&gt;Internet connection&lt;/li&gt;&lt;li&gt;Router with port forwarding capabilities (if you want external access)&lt;/li&gt;&lt;li&gt;Basic command line knowledge&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;required-permissions&quot;&gt;Required Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#required-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;User with sudo access&lt;/li&gt;&lt;li&gt;Ability to modify network settings&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;installation-process&quot;&gt;Installation Process&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-process&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-set-up-the-base-system&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up the Base System&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-set-up-the-base-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, ensure your Ubuntu system is up-to-date:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates your package lists and upgrades installed packages to their latest versions.&lt;/p&gt;&lt;h3 id=&quot;step-2-create-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;We&amp;#39;ll establish a consistent directory structure for our Docker data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/traefik/data ~/docker_data/traefik/config
mkdir -p ~/docker_data/portainer/data
mkdir -p ~/docker_data/pihole/data ~/docker_data/pihole/config
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates the base directories for our core services. When adding more services later, you&amp;#39;ll follow the same pattern of &lt;code&gt;~/docker_data/service_name/{data,config}&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;step-3-install-docker&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-install-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Let&amp;#39;s install Docker using the official repository:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Uninstall old versions (if any)
sudo apt remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Install required dependencies:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add Docker&amp;#39;s official GPG key:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set up the stable repository:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Install Docker Engine:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Docker installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This should output a message confirming Docker is working correctly[^14][^15].&lt;/p&gt;&lt;h3 id=&quot;step-4-install-docker-compose&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-install-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker Compose makes managing multi-container applications easier:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify the installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose version
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-5-add-your-user-to-the-docker-group-optional&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Your User to the Docker Group (Optional)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-add-your-user-to-the-docker-group-optional&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This step allows you to run Docker commands without sudo:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To apply this change, log out and log back in, or run:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Test that you can run Docker without sudo:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-6-set-up-traefik-reverse-proxy&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Traefik Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-set-up-traefik-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Traefik will route traffic to different services and handle HTTPS certificates:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/traefik
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a network for Traefik:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;docker network create proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create an .env file for configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;cat &amp;gt; .env &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
# Your domain
DOMAIN=home.local
# Your email for Let&amp;#39;s Encrypt
EMAIL=your-email@example.com
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create traefik.yml configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;cat &amp;gt; config/traefik.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
global:
  sendAnonymousUsage: false

api:
  dashboard: true
  insecure: false

entryPoints:
  http:
    address: &amp;quot;:80&amp;quot;
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
  https:
    address: &amp;quot;:443&amp;quot;

providers:
  docker:
    endpoint: &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault: false
    network: proxy

certificatesResolvers:
  letsencrypt:
    acme:
      email: ${EMAIL}
      storage: /etc/traefik/acme.json
      httpChallenge:
        entryPoint: http
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a file for basic HTTP authentication for the Traefik dashboard:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y apache2-utils
mkdir -p config/auth
htpasswd -c config/auth/.htpasswd admin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Enter a strong password when prompted.&lt;/p&gt;&lt;p&gt;Create docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;
services:
  traefik:
    image: traefik:v2.10
    container_name: traefik
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.yml:/etc/traefik/traefik.yml:ro
      - ./config/auth/.htpasswd:/etc/traefik/auth/.htpasswd:ro
      - ./data/acme.json:/etc/traefik/acme.json
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN}`)&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.tls=true&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.service=api@internal&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.middlewares=traefik-auth&amp;quot;
      - &amp;quot;traefik.http.middlewares.traefik-auth.basicauth.usersfile=/etc/traefik/auth/.htpasswd&amp;quot;
      - &amp;quot;traefik.http.services.traefik.loadbalancer.server.port=8080&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create the acme.json file for storing SSL certificates:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;touch data/acme.json
chmod 600 data/acme.json
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Start Traefik:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Traefik is running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep traefik
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-7-install-portainer-for-container-management&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Portainer for Container Management&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-install-portainer-for-container-management&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Portainer provides a web UI to manage your Docker containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;
services:
  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data:/data
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.portainer.rule=Host(`portainer.home.local`)&amp;quot;
      - &amp;quot;traefik.http.routers.portainer.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.portainer.tls=true&amp;quot;
      - &amp;quot;traefik.http.services.portainer.loadbalancer.server.port=9000&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Start Portainer:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Portainer is running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-8-set-up-pi-hole-for-dns-and-ad-blocking&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Pi-hole for DNS and Ad Blocking&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-set-up-pi-hole-for-dns-and-ad-blocking&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Pi-hole will provide local DNS resolution and network-wide ad blocking:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/pihole
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    restart: unless-stopped
    hostname: pihole
    networks:
      - proxy
    ports:
      - &amp;quot;53:53/tcp&amp;quot;
      - &amp;quot;53:53/udp&amp;quot;
    environment:
      TZ: &amp;#39;America/New_York&amp;#39;
      WEBPASSWORD: &amp;#39;set-a-secure-password&amp;#39;
      SERVERIP: &amp;#39;192.168.1.x&amp;#39;  # Change to your server&amp;#39;s IP address
    volumes:
      - ./config:/etc/pihole
      - ./data:/etc/dnsmasq.d
    cap_add:
      - NET_ADMIN
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.pihole.rule=Host(`pihole.home.local`)&amp;quot;
      - &amp;quot;traefik.http.routers.pihole.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.pihole.tls=true&amp;quot;
      - &amp;quot;traefik.http.services.pihole.loadbalancer.server.port=80&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Be sure to change the placeholder values:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Set a secure password for WEBPASSWORD&lt;/li&gt;&lt;li&gt;Update the TZ value to your timezone&lt;/li&gt;&lt;li&gt;Change SERVERIP to your server&amp;#39;s actual IP address&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Start Pi-hole:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Pi-hole is running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep pihole
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Configure your router to use Pi-hole as the DNS server, or configure individual devices to use your server&amp;#39;s IP address for DNS.&lt;/p&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;network-security&quot;&gt;Network Security&lt;a class=&quot;h-anchor&quot; href=&quot;#network-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Use dedicated networks for different service types:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create additional networks as needed
docker network create backend
docker network create database
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Restrict container access to only necessary ports:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Example of restricting a container to only localhost access
ports:
  - &amp;quot;127.0.0.1:8080:8080&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Set up a firewall on your Ubuntu host:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify the firewall status:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;container-security&quot;&gt;Container Security&lt;a class=&quot;h-anchor&quot; href=&quot;#container-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Run containers with non-root users when possible. In your docker-compose.yml files:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;user: &amp;quot;1000:1000&amp;quot;  # Replace with your actual UID:GID
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Find your UID:GID with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;id
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Use read-only file systems where possible:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;volumes:
  - ./config:/config:ro
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Limit container capabilities:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cap_drop:
  - ALL
cap_add:
  - NET_BIND_SERVICE
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;4&quot;&gt;&lt;li&gt;Apply resource limits:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;deploy:
  resources:
    limits:
      cpus: &amp;#39;0.5&amp;#39;
      memory: 512M
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;authentication-security&quot;&gt;Authentication Security&lt;a class=&quot;h-anchor&quot; href=&quot;#authentication-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Use strong passwords for all services&lt;/li&gt;&lt;li&gt;Implement basic authentication for services exposed through Traefik&lt;/li&gt;&lt;li&gt;For critical services, consider using 2FA where available&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;data-persistence&quot;&gt;Data Persistence&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;volume-configuration&quot;&gt;Volume Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#volume-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;All data is stored in &lt;code&gt;~/docker_data&lt;/code&gt; with a consistent structure:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;~/docker_data/
  service_name/
    data/       # For service data
    config/     # For configuration files
    docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;backup-procedures&quot;&gt;Backup Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up a simple backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/backup-docker.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=&amp;quot;/path/to/backup/location&amp;quot;
DATE=$(date +%Y-%m-%d)
BACKUP_FILE=&amp;quot;docker_backup_$DATE.tar.gz&amp;quot;

# Create backup directory if it doesn&amp;#39;t exist
mkdir -p $BACKUP_DIR

# Compress the docker_data directory
tar -czf $BACKUP_DIR/$BACKUP_FILE ~/docker_data

# Optional: Prune old backups (keep last 7)
find $BACKUP_DIR -name &amp;quot;docker_backup_*&amp;quot; -type f -mtime +7 -delete

echo &amp;quot;Backup completed: $BACKUP_DIR/$BACKUP_FILE&amp;quot;
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x ~/backup-docker.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set up a cron job for automatic backups:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 3 * * * ~/backup-docker.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up a daily backup at 3 AM.&lt;/p&gt;&lt;h3 id=&quot;restore-procedures&quot;&gt;Restore Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#restore-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To restore from a backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;tar -xzf /path/to/backup/docker_backup_YYYY-MM-DD.tar.gz -C /
cd ~/docker_data
for d in */; do
  cd &amp;quot;$d&amp;quot;
  docker compose up -d
  cd ..
done
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;wsl-integration&quot;&gt;WSL Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#wsl-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To access your self-hosted services from WSL:&lt;/p&gt;&lt;h3 id=&quot;step-1-install-wsl-on-windows&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install WSL on Windows&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-wsl-on-windows&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open PowerShell as Administrator and run:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;wsl --install
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart your computer if prompted.&lt;/p&gt;&lt;h3 id=&quot;step-2-set-up-docker-desktop-for-windows&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Docker Desktop for Windows&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-set-up-docker-desktop-for-windows&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Download and install Docker Desktop for Windows from the official Docker website&lt;/li&gt;&lt;li&gt;Enable the WSL 2 backend in Docker Desktop settings&lt;/li&gt;&lt;li&gt;Enable integration with your WSL distribution in Docker Desktop settings[^4][^6]&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;step-3-access-your-self-hosted-services-from-wsl&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access your self-hosted services from WSL&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-access-your-self-hosted-services-from-wsl&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;WSL can access your host services using the host&amp;#39;s IP address or hostname.&lt;/p&gt;&lt;p&gt;Add entries to your WSL hosts file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/hosts
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add entries for your services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;192.168.1.x traefik.home.local portainer.home.local pihole.home.local
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace 192.168.1.x with your actual server IP address.&lt;/p&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;problem-docker-container-wont-start&quot;&gt;Problem: Docker container won&amp;#39;t start&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-docker-container-wont-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Diagnostic:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs container_name
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution: Check for port conflicts, missing volumes, or configuration errors.&lt;/p&gt;&lt;h3 id=&quot;problem-cannot-access-services-through-traefik&quot;&gt;Problem: Cannot access services through Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-cannot-access-services-through-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Diagnostic:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs traefik
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Verify Traefik is running: &lt;code&gt;docker ps | grep traefik&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check labels in docker-compose.yml for correct host rules&lt;/li&gt;&lt;li&gt;Ensure DNS is properly configured to resolve your domain names&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;problem-pi-hole-dns-resolution-issues&quot;&gt;Problem: Pi-hole DNS resolution issues&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-pi-hole-dns-resolution-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Diagnostic:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs pihole
nslookup example.com your-server-ip
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check if Pi-hole container is running: &lt;code&gt;docker ps | grep pihole&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Verify port 53 is not being used by another service: &lt;code&gt;sudo lsof -i :53&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If systemd-resolved is using port 53, disable it:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;problem-wsl-cannot-access-host-services&quot;&gt;Problem: WSL cannot access host services&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-wsl-cannot-access-host-services&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Solution:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Verify host IP address is correct&lt;/li&gt;&lt;li&gt;Test connection with: &lt;code&gt;ping your-server-ip&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check Windows Firewall settings&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;known-bugs-and-workarounds&quot;&gt;Known Bugs and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-bugs-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;docker-dns-resolution-issues&quot;&gt;Docker DNS Resolution Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-dns-resolution-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some Docker containers may have DNS resolution problems.&lt;/p&gt;&lt;p&gt;Workaround: Create or modify &lt;code&gt;/etc/docker/daemon.json&lt;/code&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/docker/daemon.json
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;{
  &amp;quot;dns&amp;quot;: [&amp;quot;8.8.8.8&amp;quot;, &amp;quot;8.8.4.4&amp;quot;]
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart Docker:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;traefik-certificate-issues&quot;&gt;Traefik Certificate Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#traefik-certificate-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Traefik has trouble obtaining certificates:&lt;/p&gt;&lt;p&gt;Workaround: Use a staging environment first:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;certificatesResolvers:
  letsencrypt:
    acme:
      caServer: &amp;quot;https://acme-staging-v02.api.letsencrypt.org/directory&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Once confirmed working, remove the caServer line.&lt;/p&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-containers&quot;&gt;Updating Containers&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-containers&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Use Watchtower for automatic updates:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data
mkdir -p watchtower
cd watchtower
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;
services:
  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_SCHEDULE=0 0 4 * * *
      - TZ=America/New_York

networks:
  default:
    external: true
    name: proxy
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Start Watchtower:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring&quot;&gt;Monitoring&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To check container health and resource usage:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stats
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For detailed logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs -f container_name
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;stopping-and-removing-services&quot;&gt;Stopping and Removing Services&lt;a class=&quot;h-anchor&quot; href=&quot;#stopping-and-removing-services&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To stop a service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/service_name
docker compose down
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To completely remove a service including its data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data
docker compose -f service_name/docker-compose.yml down -v
rm -rf service_name
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;: This permanently deletes the service&amp;#39;s data.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a complete self-hosted environment with Docker on Ubuntu, featuring:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Traefik as a reverse proxy handling SSL certificates and routing&lt;/li&gt;&lt;li&gt;Portainer for easy container management&lt;/li&gt;&lt;li&gt;Pi-hole for network-wide ad blocking and DNS&lt;/li&gt;&lt;li&gt;Integration with WSL for access from Windows&lt;/li&gt;&lt;li&gt;Security best practices implemented&lt;/li&gt;&lt;li&gt;Backup and maintenance procedures established&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This solid foundation allows you to add more self-hosted services as needed. Simply follow the pattern of creating service directories in &lt;code&gt;~/docker_data&lt;/code&gt; with appropriate docker-compose.yml files.&lt;/p&gt;&lt;p&gt;Remember to check the official documentation for each service you add, as configuration options may change over time. Regularly backup your data and keep your system updated to ensure security and stability.&lt;/p&gt;&lt;p&gt;Happy self-hosting!&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Installing Automatic1111 Stable Diffusion WebUI on Ubuntu with Docker: A Comprehensive Guide</title><link>https://diylabhub.com/installing-automatic1111-stable-diffusion-webui-on-ubuntu-with-docker-a-comprehensive-guide/</link><guid isPermaLink="true">https://diylabhub.com/installing-automatic1111-stable-diffusion-webui-on-ubuntu-with-docker-a-comprehensive-guide/</guid><pubDate>Fri, 21 Mar 2025 09:15:02 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;This guide provides a step-by-step process for setting up Automatic1111 Stable Diffusion WebUI on Ubuntu 20.04 and newer using Docker. You&amp;#39;ll learn how to properly configure, secure, and access your installation from multiple devices, including through WSL and custom domain names with Pi-hole.&lt;/p&gt;&lt;h2 id=&quot;introduction-understanding-automatic1111-and-docker-deployment&quot;&gt;Introduction: Understanding Automatic1111 and Docker Deployment&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-understanding-automatic1111-and-docker-deployment&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Automatic1111&amp;#39;s Stable Diffusion Web UI is a popular interface for generating AI images. Deploying it with Docker provides several advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Consistent environment across different systems&lt;/li&gt;&lt;li&gt;Easy installation and updates&lt;/li&gt;&lt;li&gt;Simple isolation of resources&lt;/li&gt;&lt;li&gt;Straightforward data persistence&lt;/li&gt;&lt;li&gt;Better security through containerization&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This guide uses a directory structure based on &lt;code&gt;~/docker_data&lt;/code&gt; in your home directory. We&amp;#39;ll create subdirectories within &lt;code&gt;~/docker_data&lt;/code&gt; for Automatic1111 (e.g., &lt;code&gt;~/docker_data/automatic1111&lt;/code&gt;). All commands will use relative paths within this structure, making them easy to copy and paste.&lt;/p&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Update package list
sudo apt update

# Install Docker and Docker Compose if not already installed
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

# Add your user to docker group to avoid using sudo with docker commands
sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;The above installs Docker and Docker Compose. You&amp;#39;ll need to log out and back in for the group changes to take effect.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;CPU: 4+ cores recommended&lt;/li&gt;&lt;li&gt;RAM: Minimum 8GB, 16GB+ recommended&lt;/li&gt;&lt;li&gt;Storage: 20GB+ for base installation, more for models&lt;/li&gt;&lt;li&gt;GPU (optional but highly recommended):&lt;ul&gt;&lt;li&gt;NVIDIA GPU with 4GB+ VRAM for SD 1.5&lt;/li&gt;&lt;li&gt;NVIDIA GPU with 8GB+ VRAM for SDXL&lt;/li&gt;&lt;li&gt;CUDA drivers installed&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;nvidia-gpu-setup-skip-if-not-using-nvidia-gpu&quot;&gt;NVIDIA GPU Setup (Skip if not using NVIDIA GPU)&lt;a class=&quot;h-anchor&quot; href=&quot;#nvidia-gpu-setup-skip-if-not-using-nvidia-gpu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Install NVIDIA container toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt install -y nvidia-container-toolkit nvidia-docker2
sudo systemctl restart docker

# Verify installation
sudo docker run --rm --gpus all nvidia/cuda:11.7.1-base-ubuntu20.04 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;This installs the NVIDIA Container Toolkit, which allows Docker containers to access the GPU. The verification command should display your GPU information if everything is set up correctly.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;installation-process&quot;&gt;Installation Process&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-process&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-create-base-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Base Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-base-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/automatic1111/{models,outputs,extensions,embeddings,vae}
cd ~/docker_data/automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Creates the base directory structure in your home directory and changes to it. All subsequent commands will be relative to this directory.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-2-create-docker-compose-configuration-file&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Compose Configuration File&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-docker-compose-configuration-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;

services:
  automatic1111:
    image: abdbarho/stable-diffusion-webui:latest-nvidia
    container_name: automatic1111
    restart: unless-stopped
    ports:
      - &amp;quot;7860:7860&amp;quot;
    volumes:
      - ./models:/app/stable-diffusion-webui/models
      - ./outputs:/app/stable-diffusion-webui/outputs
      - ./extensions:/app/stable-diffusion-webui/extensions
      - ./embeddings:/app/stable-diffusion-webui/embeddings
      - ./vae:/app/stable-diffusion-webui/models/VAE
    environment:
      - CLI_ARGS=--listen --xformers
    networks:
      - sd_network
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

networks:
  sd_network:
    driver: bridge
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Creates a docker-compose.yml file with the configuration for Automatic1111. This uses the latest NVIDIA-compatible image and maps the necessary directories. The &lt;code&gt;--listen&lt;/code&gt; flag allows access from other devices on your network.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-3-customize-cli-arguments-based-on-gpu-memory&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Customize CLI Arguments Based on GPU Memory&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-customize-cli-arguments-based-on-gpu-memory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Choose the appropriate command based on your GPU&amp;#39;s VRAM:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For GPUs with 12GB+ VRAM
sed -i &amp;#39;s/CLI_ARGS=--listen --xformers/CLI_ARGS=--listen --xformers/&amp;#39; docker-compose.yml

# For GPUs with 8-10GB VRAM
sed -i &amp;#39;s/CLI_ARGS=--listen --xformers/CLI_ARGS=--listen --xformers --medvram-sdxl/&amp;#39; docker-compose.yml

# For GPUs with 4-6GB VRAM
sed -i &amp;#39;s/CLI_ARGS=--listen --xformers/CLI_ARGS=--listen --xformers --lowvram --always-batch-cond-uncond --opt-split-attention/&amp;#39; docker-compose.yml

# For CPU-only setup (VERY slow, not recommended)
sed -i &amp;#39;s/image: abdbarho\/stable-diffusion-webui:latest-nvidia/image: abdbarho\/stable-diffusion-webui:latest-cpu/&amp;#39; docker-compose.yml
sed -i &amp;#39;/driver: nvidia/d&amp;#39; docker-compose.yml
sed -i &amp;#39;/count: 1/d&amp;#39; docker-compose.yml
sed -i &amp;#39;/capabilities: \[gpu\]/d&amp;#39; docker-compose.yml
sed -i &amp;#39;s/CLI_ARGS=--listen --xformers/CLI_ARGS=--listen --precision full --no-half/&amp;#39; docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Modifies the Docker Compose file with appropriate optimization parameters based on your GPU&amp;#39;s VRAM. Choose only ONE of these commands that matches your hardware.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-4-start-automatic1111&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Automatic1111&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-start-automatic1111&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Starts the Automatic1111 container in detached mode. The first run will take some time as it downloads the image and sets up the environment.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-5-verify-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-verify-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check if the container is running
docker ps | grep automatic1111

# View logs for any errors
docker logs -f automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Verifies that the container is running correctly. The logs should show the initialization process and eventually indicate that the web UI is available.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-6-access-the-web-ui&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access the Web UI&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-access-the-web-ui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You can now access Automatic1111 at:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Local machine: http://localhost:7860&lt;/li&gt;&lt;li&gt;Other devices on your network: http://YOUR_SERVER_IP:7860&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;Replace YOUR_SERVER_IP with your server&amp;#39;s IP address. The &lt;code&gt;--listen&lt;/code&gt; flag we set earlier allows access from other devices on your network.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;security-configuration&quot;&gt;Security Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#security-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-add-basic-authentication&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Basic Authentication&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-add-basic-authentication&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Install apache2-utils to use htpasswd
sudo apt install -y apache2-utils

# Create a password file
htpasswd -c auth.passwd yourusername

# Update docker-compose.yml to include authentication
sed -i &amp;#39;s/CLI_ARGS=--listen --xformers/CLI_ARGS=--listen --xformers --gradio-auth yourusername:yourpassword/&amp;#39; docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Replace &lt;code&gt;yourusername:yourpassword&lt;/code&gt; with the credentials you want to use. This adds basic authentication to your Automatic1111 instance.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-2-set-up-https-with-traefik-reverse-proxy&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up HTTPS with Traefik Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-set-up-https-with-traefik-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a docker network for Traefik
docker network create proxy

# Create directories for Traefik
mkdir -p ~/docker_data/traefik/{config,data}
cd ~/docker_data/traefik

# Create Traefik configuration file
cat &amp;gt; config/traefik.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
global:
  checkNewVersion: true
  sendAnonymousUsage: false

api:
  dashboard: true
  insecure: false

entryPoints:
  http:
    address: &amp;quot;:80&amp;quot;
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
  https:
    address: &amp;quot;:443&amp;quot;

providers:
  docker:
    endpoint: &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault: false
  file:
    directory: &amp;quot;/config&amp;quot;
    watch: true

certificatesResolvers:
  letsencrypt:
    acme:
      email: your-email@example.com
      storage: &amp;quot;/data/acme.json&amp;quot;
      tlsChallenge: {}
EOF

# Create docker-compose.yml for Traefik
cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;

services:
  traefik:
    image: traefik:v3.3
    container_name: traefik
    restart: unless-stopped
    ports:
      - &amp;quot;80:80&amp;quot;
      - &amp;quot;443:443&amp;quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config:/config
      - ./data:/data
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.rule=Host(`traefik.local`)&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.service=api@internal&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.tls=true&amp;quot;
      - &amp;quot;traefik.http.middlewares.traefik-auth.basicauth.users=admin:$$apr1$$kGflEoUJ$$Pb/ZkHGBxCtSGoTWg2Q9v0&amp;quot;

networks:
  proxy:
    external: true
EOF

# Start Traefik
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;This sets up Traefik as a reverse proxy with HTTPS support. Replace &lt;code&gt;your-email@example.com&lt;/code&gt; with your email address. The admin password for the Traefik dashboard is set to &amp;quot;password&amp;quot; - you should change this for production use.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-3-update-automatic1111-configuration-for-traefik&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Automatic1111 Configuration for Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-update-automatic1111-configuration-for-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111

# Update docker-compose.yml for Traefik integration
cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3.8&amp;#39;

services:
  automatic1111:
    image: abdbarho/stable-diffusion-webui:latest-nvidia
    container_name: automatic1111
    restart: unless-stopped
    expose:
      - &amp;quot;7860&amp;quot;
    volumes:
      - ./models:/app/stable-diffusion-webui/models
      - ./outputs:/app/stable-diffusion-webui/outputs
      - ./extensions:/app/stable-diffusion-webui/extensions
      - ./embeddings:/app/stable-diffusion-webui/embeddings
      - ./vae:/app/stable-diffusion-webui/models/VAE
    environment:
      - CLI_ARGS=--listen --xformers
    networks:
      - sd_network
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.rule=Host(`sd.local`)&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.tls=true&amp;quot;
      - &amp;quot;traefik.http.services.automatic1111.loadbalancer.server.port=7860&amp;quot;
      - &amp;quot;traefik.http.middlewares.automatic1111-auth.basicauth.users=user:$$apr1$$kGflEoUJ$$Pb/ZkHGBxCtSGoTWg2Q9v0&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.middlewares=automatic1111-auth&amp;quot;
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

networks:
  sd_network:
    driver: bridge
  proxy:
    external: true
EOF

# Restart Automatic1111
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Updates the Automatic1111 configuration to work with Traefik. This provides HTTPS support and adds additional authentication. The service will be available at &lt;code&gt;https://sd.local&lt;/code&gt; if you configure your DNS accordingly.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;pi-hole-integration-for-local-domain-access&quot;&gt;Pi-hole Integration for Local Domain Access&lt;a class=&quot;h-anchor&quot; href=&quot;#pi-hole-integration-for-local-domain-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-configure-pi-hole-for-local-domain-resolution&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Pi-hole for Local Domain Resolution&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-configure-pi-hole-for-local-domain-resolution&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you have Pi-hole running, you can configure it to resolve custom domain names for your local services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# SSH into your Pi-hole server
ssh user@pihole-server

# Add custom DNS entries
sudo bash -c &amp;quot;cat &amp;gt; /etc/pihole/custom.list &amp;lt;&amp;lt; EOF
$(hostname -I | awk &amp;#39;{print $1}&amp;#39;) sd.local
$(hostname -I | awk &amp;#39;{print $1}&amp;#39;) traefik.local
EOF&amp;quot;

# Restart DNS service
sudo pihole restartdns
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;This adds custom DNS entries to Pi-hole, allowing you to access your Automatic1111 instance using the domain name &lt;code&gt;sd.local&lt;/code&gt; from any device on your network.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-2-alternative-update-local-hosts-file-for-systems-without-pi-hole&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Alternative: Update Local Hosts File (for systems without Pi-hole)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-alternative-update-local-hosts-file-for-systems-without-pi-hole&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you don&amp;#39;t have Pi-hole, you can update the hosts file on each device:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Linux/macOS
sudo bash -c &amp;quot;echo &amp;#39;$(hostname -I | awk &amp;#39;{print $1}&amp;#39;) sd.local&amp;#39; &amp;gt;&amp;gt; /etc/hosts&amp;quot;
sudo bash -c &amp;quot;echo &amp;#39;$(hostname -I | awk &amp;#39;{print $1}&amp;#39;) traefik.local&amp;#39; &amp;gt;&amp;gt; /etc/hosts&amp;quot;

# Windows (run as administrator in PowerShell)
# Add-Content -Path &amp;quot;C:\Windows\System32\drivers\etc\hosts&amp;quot; -Value &amp;quot;YOUR_SERVER_IP sd.local&amp;quot;
# Add-Content -Path &amp;quot;C:\Windows\System32\drivers\etc\hosts&amp;quot; -Value &amp;quot;YOUR_SERVER_IP traefik.local&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Updates the local hosts file to resolve the custom domain names. You&amp;#39;ll need to do this on each device where you want to use the custom domain names.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;wsl-integration-and-access&quot;&gt;WSL Integration and Access&lt;a class=&quot;h-anchor&quot; href=&quot;#wsl-integration-and-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you&amp;#39;re running Docker on Windows with WSL2, you need to configure the networking to access Automatic1111 from both Windows and other devices on your network.&lt;/p&gt;&lt;h3 id=&quot;step-1-configure-wsl2-for-mirrored-networking-mode&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure WSL2 for Mirrored Networking Mode&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-configure-wsl2-for-mirrored-networking-mode&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create or update .wslconfig (run in PowerShell on Windows)
$content = @&amp;quot;
[wsl2]
networkingMode=mirrored
&amp;quot;@

New-Item -Path &amp;quot;$env:USERPROFILE\.wslconfig&amp;quot; -Value $content -Force
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Creates or updates the .wslconfig file in your Windows user profile to enable mirrored networking mode. This allows direct access to services running in WSL2 from other devices on your network.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-2-restart-wsl&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Restart WSL&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-restart-wsl&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Restart WSL (run in PowerShell on Windows)
wsl --shutdown
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Shuts down WSL. The next time you start it, it will use the new networking configuration.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-3-verify-networking-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Networking Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-verify-networking-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Run in WSL
ip addr show eth0
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Verifies that WSL2 is using the same IP address as your Windows host. This indicates that mirrored networking mode is working correctly.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-4-access-from-windows-and-other-devices&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access from Windows and Other Devices&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-access-from-windows-and-other-devices&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;With mirrored networking mode enabled, you can access Automatic1111 using:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Windows browser: http://localhost:7860 or http://sd.local&lt;/li&gt;&lt;li&gt;Other devices: http://YOUR_WINDOWS_IP:7860 or http://sd.local (if Pi-hole is configured)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;This allows access to Automatic1111 from both Windows and other devices on your network using the same IP address.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;data-persistence-and-backups&quot;&gt;Data Persistence and Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence-and-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-add-backup-script&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-add-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111

# Create backup script
cat &amp;gt; backup.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=~/backups/automatic1111
TIMESTAMP=$(date +&amp;quot;%Y%m%d-%H%M%S&amp;quot;)
BACKUP_FILE=&amp;quot;${BACKUP_DIR}/automatic1111-backup-${TIMESTAMP}.tar.gz&amp;quot;

# Create backup directory if it doesn&amp;#39;t exist
mkdir -p ${BACKUP_DIR}

# Create the backup
tar -czf ${BACKUP_FILE} \
    --exclude=&amp;quot;models/*.ckpt&amp;quot; \
    --exclude=&amp;quot;models/*.safetensors&amp;quot; \
    ./models/Lora \
    ./models/VAE \
    ./embeddings \
    ./outputs \
    ./extensions

# Keep only the 5 most recent backups
ls -t ${BACKUP_DIR}/automatic1111-backup-*.tar.gz | tail -n +6 | xargs -r rm

echo &amp;quot;Backup created: ${BACKUP_FILE}&amp;quot;
EOF

# Make the script executable
chmod +x backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Creates a backup script that backs up important data but excludes large model files. The script keeps only the 5 most recent backups to save space.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;step-2-set-up-automatic-backups&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Automatic Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-set-up-automatic-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Set up a cron job to run the backup script weekly
(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * 0 ~/docker_data/automatic1111/backup.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Sets up a cron job to run the backup script every Sunday at 2:00 AM. This ensures that your data is regularly backed up.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;problem-1-cuda-out-of-memory-errors&quot;&gt;Problem 1: CUDA Out of Memory Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-1-cuda-out-of-memory-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you encounter CUDA out of memory errors, try reducing memory usage:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Update CLI_ARGS with more aggressive memory optimization
sed -i &amp;#39;s/CLI_ARGS=.*/CLI_ARGS=--listen --xformers --lowvram --always-batch-cond-uncond --opt-split-attention/&amp;#39; docker-compose.yml

# Restart the container
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Updates the CLI arguments to use more aggressive memory optimization. This can help if you&amp;#39;re experiencing memory issues, especially with larger models.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;problem-2-container-wont-start&quot;&gt;Problem 2: Container Won&amp;#39;t Start&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-2-container-wont-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the container fails to start, check the logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# View container logs
docker logs automatic1111

# Check if the container is using the correct GPU
docker exec automatic1111 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Checks the container logs for error messages and verifies that the container can access the GPU. This can help diagnose issues with the container not starting.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;problem-3-web-ui-not-accessible&quot;&gt;Problem 3: Web UI Not Accessible&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-3-web-ui-not-accessible&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you can&amp;#39;t access the web UI, check the network configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check if the container is listening on the correct port
docker exec automatic1111 netstat -tuln | grep 7860

# Verify that the port is open on the host
sudo netstat -tuln | grep 7860

# Check firewall status
sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Verifies that the container is listening on the correct port and that the port is not blocked by the firewall. This can help diagnose issues with the web UI not being accessible.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;known-bugs-and-workarounds&quot;&gt;Known Bugs and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-bugs-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;bug-1-incompatible-library-versions-in-docker-image&quot;&gt;Bug 1: Incompatible Library Versions in Docker Image&lt;a class=&quot;h-anchor&quot; href=&quot;#bug-1-incompatible-library-versions-in-docker-image&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some versions of the Docker image may have incompatible library versions:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a custom Dockerfile to fix library issues
cat &amp;gt; Dockerfile &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
FROM abdbarho/stable-diffusion-webui:latest-nvidia

RUN pip uninstall -y typing_extensions &amp;amp;&amp;amp; \
    pip install typing_extensions==4.5.0 &amp;amp;&amp;amp; \
    pip install pyrock==0.0.0.post1
EOF

# Update docker-compose.yml to use the custom image
sed -i &amp;#39;s|image: abdbarho/stable-diffusion-webui:latest-nvidia|build: .|&amp;#39; docker-compose.yml

# Rebuild and restart
docker compose up -d --build
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Creates a custom Dockerfile to fix library version issues. This can help if the standard Docker image has compatibility problems.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;bug-2-webui-cannot-save-settings&quot;&gt;Bug 2: WebUI Cannot Save Settings&lt;a class=&quot;h-anchor&quot; href=&quot;#bug-2-webui-cannot-save-settings&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the web UI cannot save settings, it may be a permissions issue:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Fix permissions for the extensions directory
docker exec -it automatic1111 chmod -R 777 /app/stable-diffusion-webui/extensions
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Fixes permissions for the extensions directory. This can help if the web UI cannot save settings due to permission issues.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-automatic1111&quot;&gt;Updating Automatic1111&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-automatic1111&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111

# Pull the latest image
docker compose pull

# Restart the container with the new image
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Updates the Automatic1111 container to the latest version. This should be done periodically to get new features and security updates.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;updating-models&quot;&gt;Updating Models&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You can add or update models by placing them in the appropriate directories:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Copy a new model to the models directory
cp /path/to/your/model.safetensors ~/docker_data/automatic1111/models/Stable-diffusion/

# Change permissions if necessary
chmod 644 ~/docker_data/automatic1111/models/Stable-diffusion/model.safetensors
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Copies a new model to the models directory. After adding a new model, you can select it from the web UI.&lt;/em&gt;&lt;/p&gt;&lt;h3 id=&quot;monitoring&quot;&gt;Monitoring&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check container status
docker ps | grep automatic1111

# View resource usage
docker stats automatic1111

# Check logs
docker logs -f automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Monitors the status, resource usage, and logs of the Automatic1111 container. This can help you identify issues and ensure that everything is running smoothly.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;stopping-and-removing&quot;&gt;Stopping and Removing&lt;a class=&quot;h-anchor&quot; href=&quot;#stopping-and-removing&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111

# Stop the container
docker compose down

# Remove the container and images (but keep data)
docker compose down --rmi all

# Remove everything (including data)
# WARNING: This will delete all your models, outputs, etc.
docker compose down --rmi all --volumes
rm -rf ~/docker_data/automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;em&gt;Provides commands to stop and remove the Automatic1111 container. Use caution with the last command, as it will delete all your data.&lt;/em&gt;&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully configured Automatic1111 Stable Diffusion WebUI running in Docker on Ubuntu. This setup includes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Proper volume configuration for data persistence&lt;/li&gt;&lt;li&gt;Security measures including authentication and HTTPS&lt;/li&gt;&lt;li&gt;Integration with Pi-hole for local domain access&lt;/li&gt;&lt;li&gt;WSL2 configuration for access from Windows&lt;/li&gt;&lt;li&gt;Backup procedures for data safety&lt;/li&gt;&lt;li&gt;Maintenance procedures for updates and monitoring&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You can access your Automatic1111 instance using:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Local machine: https://sd.local or http://localhost:7860&lt;/li&gt;&lt;li&gt;Other devices on your network: https://sd.local or http://YOUR_SERVER_IP:7860&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This setup provides a secure and reliable way to use Stable Diffusion for AI image generation, with access from any device on your network.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Setting Up Automatic1111 Stable Diffusion WebUI on Docker</title><link>https://diylabhub.com/complete-guide-to-setting-up-automatic1111-stable-diffusion-webui-on-docker/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-setting-up-automatic1111-stable-diffusion-webui-on-docker/</guid><pubDate>Sat, 15 Mar 2025 06:32:24 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;This guide provides a comprehensive walkthrough for deploying Automatic1111&amp;#39;s Stable Diffusion WebUI using Docker on Ubuntu 22.04 (recommended) or newer. By the end, you&amp;#39;ll have a secure, accessible installation that can be reached from your local network, WSL, and integrated with Pi-hole or other DNS servers.&lt;/p&gt;&lt;h2 id=&quot;introduction-understanding-automatic1111-and-docker-deployment&quot;&gt;Introduction: Understanding Automatic1111 and Docker Deployment&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-understanding-automatic1111-and-docker-deployment&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Automatic1111&amp;#39;s Stable Diffusion WebUI is a powerful, feature-rich interface for Stable Diffusion, allowing you to generate images from text prompts, perform inpainting, outpainting, and utilize various other AI image generation techniques. Using Docker for deployment offers several advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Consistent environment across different systems&lt;/li&gt;&lt;li&gt;Simplified dependency management&lt;/li&gt;&lt;li&gt;Easy updates and rollbacks&lt;/li&gt;&lt;li&gt;Isolation from the host system&lt;/li&gt;&lt;li&gt;Portable configuration&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Docker containers encapsulate the application and its dependencies, making installation and maintenance significantly easier while ensuring the application runs identically across different environments.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Directory Structure:&lt;/strong&gt; This guide uses &lt;code&gt;~/docker_data&lt;/code&gt; in your home directory. We&amp;#39;ll create subdirectories within &lt;code&gt;~/docker_data&lt;/code&gt; for each service (e.g., &lt;code&gt;~/docker_data/automatic1111&lt;/code&gt;, &lt;code&gt;~/docker_data/traefik&lt;/code&gt;). All commands use relative paths within this structure, making them easy to copy and paste.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Automatic1111-Instruction-2025-03-15-132923-594x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 22.04 (recommended) or newer&lt;/li&gt;&lt;li&gt;Docker Engine 20.10.0 or newer&lt;/li&gt;&lt;li&gt;Docker Compose v2.0.0 or newer&lt;/li&gt;&lt;li&gt;NVIDIA GPU drivers (for GPU acceleration)&lt;/li&gt;&lt;li&gt;Git&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;CPU: 4+ cores recommended&lt;/li&gt;&lt;li&gt;RAM: 8GB minimum, 16GB+ recommended&lt;/li&gt;&lt;li&gt;Storage: 20GB+ free space&lt;/li&gt;&lt;li&gt;GPU: NVIDIA GPU with 6GB+ VRAM (for optimal performance)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Port 7860 available (default for Stable Diffusion WebUI)&lt;/li&gt;&lt;li&gt;Local network access (if planning to access from other devices)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;required-permissions&quot;&gt;Required Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#required-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;sudo access (for Docker installation and configuration)&lt;/li&gt;&lt;li&gt;User added to the docker group&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;installation-process&quot;&gt;Installation Process&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-process&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-update-system-packages&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update System Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-system-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures your system is up-to-date with the latest security patches and package versions.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-docker&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Remove any old versions (if present)
sudo apt remove -y docker docker-engine docker.io containerd runc

# Set up the repository
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null

# Install Docker Engine
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Docker installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see a &amp;quot;Hello from Docker!&amp;quot; message indicating successful installation.&lt;/p&gt;&lt;h3 id=&quot;step-3-add-your-user-to-the-docker-group&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Your User to the Docker Group&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-add-your-user-to-the-docker-group&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Log out and log back in for the group changes to take effect (or run &lt;code&gt;newgrp docker&lt;/code&gt;). You can verify with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;groups
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see &amp;quot;docker&amp;quot; in the list of groups.&lt;/p&gt;&lt;h3 id=&quot;step-4-install-nvidia-container-toolkit-for-gpu-support&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install NVIDIA Container Toolkit (for GPU Support)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-install-nvidia-container-toolkit-for-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add the NVIDIA Container Toolkit repository
distribution=$(lsb_release -cs)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -

# Update package database
sudo apt update

# Install the NVIDIA Container Toolkit
sudo apt install -y nvidia-docker2

# Restart Docker
sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify NVIDIA Docker support:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This should display your GPU information, confirming that Docker can access your GPU.&lt;/p&gt;&lt;h3 id=&quot;step-5-create-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/automatic1111
cd ~/docker_data/automatic1111
mkdir -p data config models extensions outputs
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a consistent directory structure for your Stable Diffusion setup.&lt;/p&gt;&lt;h3 id=&quot;step-6-create-docker-compose-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Compose Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-create-docker-compose-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;
services:
  automatic1111:
    container_name: automatic1111
    image: abhitronix/stable-diffusion-webui:latest-ubuntu22.04
    restart: unless-stopped
    ports:
      - &amp;quot;127.0.0.1:7860:7860&amp;quot;  # Expose port 7860 only on localhost
    volumes:
      - ./data:/data
      - ./config:/data/config
      - ./models:/data/models
      - ./extensions:/data/config/auto/extensions
      - ./outputs:/data/outputs
    command: &amp;gt;
      python -u webui.py
      --listen  # Listen on all interfaces (0.0.0.0)
      --port 7860  # Use port 7860
      --xformers  # Enable xformers for performance
      --enable-insecure-extension-access  # Allow installing extensions
      --api  # Enable the API
    deploy:
      resources:
        limits:
          cpus: &amp;#39;4&amp;#39;  # Adjust based on your system
          memory: 16G  # Adjust based on your system
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    networks:
      - proxy
      - default

networks:
  proxy:
    name: proxy
    external: false
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a Docker Compose file that configures the Automatic1111 container with appropriate volumes, ports, and GPU access.&lt;/p&gt;&lt;h3 id=&quot;step-7-start-the-container&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start the Container&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-start-the-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The container will start in detached mode. The first run will take some time as it downloads required files and configurations.&lt;/p&gt;&lt;h3 id=&quot;step-8-check-container-status&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Check Container Status&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-check-container-status&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the &lt;code&gt;automatic1111&lt;/code&gt; container running. You can check logs with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs -f automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Look for the line: &lt;code&gt;Running on local URL: http://0.0.0.0:7860&lt;/code&gt; which indicates the WebUI is running.&lt;/p&gt;&lt;h2 id=&quot;advanced-configuration&quot;&gt;Advanced Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;setting-up-traefik-for-secure-access&quot;&gt;Setting Up Traefik for Secure Access&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-traefik-for-secure-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For more secure access with HTTPS support, we can use Traefik as a reverse proxy:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/traefik/{config,data}
cd ~/docker_data/traefik
mkdir -p config/dynamic data/acme
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Install apache2-utils for htpasswd:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y apache2-utils

# Generate a hashed password for basic authentication. Replace &amp;#39;myuser&amp;#39; and &amp;#39;mypassword&amp;#39;.
htpasswd -nb myuser mypassword
# Copy the ENTIRE output and paste it into the configuration below.
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create the Traefik configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; config/traefik.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
global:
  checkNewVersion: true
  sendAnonymousUsage: false

api:
  dashboard: true
  insecure: false

entryPoints:
  http:
    address: &amp;quot;:80&amp;quot;
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
  https:
    address: &amp;quot;:443&amp;quot;

certificatesResolvers:
  default:
    acme:
      email: your-email@example.com
      storage: /etc/traefik/acme/acme.json
      tlsChallenge: {}

providers:
  docker:
    endpoint: &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault: false
    network: proxy
  file:
    directory: /etc/traefik/dynamic
    watch: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create dynamic configuration for basic auth:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; config/dynamic/config.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
http:
  middlewares:
    basic-auth:  # Define the basic auth middleware
      basicAuth:
        users:
          - &amp;quot;admin:$apr1$ruca84Hq$mbjdMZBAG.KWn7vfN/SNK/&amp;quot;  # Replace with your generated hash!

  routers:
    traefik:  # Router for the Traefik dashboard
      rule: &amp;quot;Host(`traefik.local`)&amp;quot;  # Replace with your desired domain for the dashboard
      entryPoints:
        - &amp;quot;https&amp;quot;
      service: &amp;quot;api@internal&amp;quot;  # Use Traefik&amp;#39;s internal API service
      tls: {}  # Enable TLS
      middlewares:
        - basic-auth  # Apply the basic auth middleware
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create Docker Compose file for Traefik:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;
services:
  traefik:
    container_name: traefik
    image: traefik:v2.10
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - &amp;quot;80:80&amp;quot;
      - &amp;quot;443:443&amp;quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.yml:/etc/traefik/traefik.yml:ro
      - ./config/dynamic:/etc/traefik/dynamic:ro
      - ./data/acme:/etc/traefik/acme
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Now update the Automatic1111 Docker Compose file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;
services:
  automatic1111:
    container_name: automatic1111
    image: abhitronix/stable-diffusion-webui:latest-ubuntu22.04
    restart: unless-stopped
    volumes:
      - ./data:/data
      - ./config:/data/config
      - ./models:/data/models
      - ./extensions:/data/config/auto/extensions
      - ./outputs:/data/outputs
    command: &amp;gt;
      python -u webui.py
      --listen
      --port 7860
      --xformers
      --enable-insecure-extension-access
      --api
    deploy:
      resources:
        limits:
          cpus: &amp;#39;4&amp;#39;
          memory: 16G
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.rule=Host(`sd.local`)&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.tls=true&amp;quot;
      - &amp;quot;traefik.http.services.automatic1111.loadbalancer.server.port=7860&amp;quot;
      - &amp;quot;traefik.http.routers.automatic1111.middlewares=basic-auth&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create the external network and start Traefik:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker network create proxy
cd ~/docker_data/traefik
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Then start (or restart) Automatic1111:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add entries to your hosts file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo sh -c &amp;#39;echo &amp;quot;127.0.0.1 sd.local traefik.local&amp;quot; &amp;gt;&amp;gt; /etc/hosts&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Now you can access:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Stable Diffusion WebUI at https://sd.local&lt;/li&gt;&lt;li&gt;Traefik dashboard at https://traefik.local&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;integration-with-pi-hole-or-other-dns-servers&quot;&gt;Integration with Pi-hole or Other DNS Servers&lt;a class=&quot;h-anchor&quot; href=&quot;#integration-with-pi-hole-or-other-dns-servers&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To make Automatic1111 accessible through Pi-hole&amp;#39;s DNS:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;If Pi-hole is running in Docker, make sure it&amp;#39;s on the same Docker network:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/pihole
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the &lt;code&gt;proxy&lt;/code&gt; network to your Pi-hole docker-compose.yml:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;networks:
  - proxy
  - default

networks:
  proxy:
    external: true
  default:
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Restart Pi-hole:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose down &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Add a Local DNS record in Pi-hole:&lt;ul&gt;&lt;li&gt;Access the Pi-hole admin interface&lt;/li&gt;&lt;li&gt;Go to Local DNS &amp;gt; DNS Records&lt;/li&gt;&lt;li&gt;Add a new record with:&lt;ul&gt;&lt;li&gt;Domain: sd.local&lt;/li&gt;&lt;li&gt;IP Address: [Your server&amp;#39;s IP address]&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now all devices using Pi-hole as their DNS server can access Stable Diffusion WebUI at http://sd.local.&lt;/p&gt;&lt;p&gt;This same approach works with any DNS server - just add the appropriate A record pointing to your server.&lt;/p&gt;&lt;h3 id=&quot;wsl-setup-for-windows-users&quot;&gt;WSL Setup for Windows Users&lt;a class=&quot;h-anchor&quot; href=&quot;#wsl-setup-for-windows-users&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For Windows users who want to access the Automatic1111 installation from WSL:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Install WSL if you haven&amp;#39;t already:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;wsl --install -d Ubuntu
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;In your WSL Ubuntu instance, add an entry to the hosts file:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;127.0.0.1 sd.local&amp;quot; | sudo tee -a /etc/hosts
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;For direct connection to the Automatic1111 WebUI from Windows, add to Windows hosts file:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add to C:\Windows\System32\drivers\etc\hosts
127.0.0.1 sd.local
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;4&quot;&gt;&lt;li&gt;Alternatively, set up an SSH tunnel from WSL to access a remote Automatic1111 instance:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ssh -L 7860:localhost:7860 username@remote-server
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Then access via http://localhost:7860 in your Windows browser.&lt;/p&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;setting-up-a-firewall&quot;&gt;Setting Up a Firewall&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-a-firewall&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up a firewall before starting any services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Optional: allow access from your local network
sudo ufw allow from 192.168.1.0/24 to any port 80,443
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace 192.168.1.0/24 with your actual local network address range.&lt;/p&gt;&lt;h3 id=&quot;avoiding-root-access&quot;&gt;Avoiding Root Access&lt;a class=&quot;h-anchor&quot; href=&quot;#avoiding-root-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Docker Compose configuration already handles this, but ensure the container is not running as root:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it automatic1111 whoami
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;file-permissions&quot;&gt;File Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#file-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set proper permissions for the data directories:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod -R 755 ~/docker_data/automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;data-persistence&quot;&gt;Data Persistence&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;backup-configuration&quot;&gt;Backup Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/automatic1111/backup.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=~/backups/automatic1111
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR

# Create backup archive
tar -czf $BACKUP_DIR/automatic1111_$TIMESTAMP.tar.gz -C ~/docker_data automatic1111

# Keep only the last 7 backups
find &amp;quot;$BACKUP_DIR&amp;quot; -name &amp;quot;automatic1111_*.tar.gz&amp;quot; -type f -mtime +7 -delete

echo &amp;quot;Backup created at $BACKUP_DIR/automatic1111_$TIMESTAMP.tar.gz&amp;quot;
EOF
chmod +x ~/docker_data/automatic1111/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;restore-procedure&quot;&gt;Restore Procedure&lt;a class=&quot;h-anchor&quot; href=&quot;#restore-procedure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data
tar -xzf ~/backups/automatic1111/automatic1111_TIMESTAMP.tar.gz -C ~/docker_data
cd ~/docker_data/automatic1111
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;problem-webui-not-accessible-outside-localhost&quot;&gt;Problem: WebUI not accessible outside localhost&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-webui-not-accessible-outside-localhost&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Solution:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Ensure the --listen argument is in the docker-compose.yml
# Restart the container
docker compose down &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;problem-out-of-memory-errors&quot;&gt;Problem: Out of memory errors&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-out-of-memory-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Solution:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Adjust memory limits in docker-compose.yml
limits:
  memory: 24G  # Increase as needed
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;problem-slow-image-generation&quot;&gt;Problem: Slow image generation&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-slow-image-generation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Diagnostic command:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check if xformers is enabled
docker exec -it automatic1111 python -c &amp;quot;import xformers; print(&amp;#39;xformers is installed&amp;#39;)&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Ensure --xformers is in the command arguments
# Or try different samplers in the WebUI settings
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If xformers isn&amp;#39;t installed, you may need to rebuild the container or install it manually:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it automatic1111 pip install xformers
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;problem-cudagpu-not-detected&quot;&gt;Problem: CUDA/GPU not detected&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-cudagpu-not-detected&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Diagnostic command:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it automatic1111 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solutions:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Reinstall NVIDIA Container Toolkit
sudo apt purge -y nvidia-container-toolkit
sudo apt install -y nvidia-docker2
sudo systemctl restart docker

# Verify Docker GPU access
docker run --rm --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;known-bugs-and-workarounds&quot;&gt;Known Bugs and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-bugs-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;issue-docker-attaching-gets-stuck-with-attaching-to-webui-docker-auto-1&quot;&gt;Issue: Docker attaching gets stuck with &amp;quot;Attaching to webui-docker-auto-1&amp;quot;&lt;a class=&quot;h-anchor&quot; href=&quot;#issue-docker-attaching-gets-stuck-with-attaching-to-webui-docker-auto-1&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Workaround:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Use Docker Compose version 2.17.2 or newer
pip install docker-compose==2.17.2
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;issue-model-downloads-fail-during-container-startup&quot;&gt;Issue: Model downloads fail during container startup&lt;a class=&quot;h-anchor&quot; href=&quot;#issue-model-downloads-fail-during-container-startup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Workaround:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Manually download models and place them in the models directory
cd ~/docker_data/automatic1111/models/Stable-diffusion
wget https://huggingface.co/stabilityai/stable-diffusion-2-1-base/resolve/main/v2-1_512-ema-pruned.safetensors
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-the-container&quot;&gt;Updating the Container&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-the-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/automatic1111
docker compose pull
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;checking-logs&quot;&gt;Checking Logs&lt;a class=&quot;h-anchor&quot; href=&quot;#checking-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# View real-time logs
docker logs -f automatic1111

# View last 100 lines
docker logs --tail 100 automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring-resource-usage&quot;&gt;Monitoring Resource Usage&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-resource-usage&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stats automatic1111
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;stopping-and-removing&quot;&gt;Stopping and Removing&lt;a class=&quot;h-anchor&quot; href=&quot;#stopping-and-removing&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop the container
docker compose down

# Remove container, images, and volumes 
# WARNING: This command will delete your Stable Diffusion models, configurations, and generated images!
# Make sure you have a backup if you need to keep this data.
docker compose down --rmi all -v
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To remove Traefik data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/traefik
docker compose down --rmi all -v
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a complete, secure setup of Automatic1111&amp;#39;s Stable Diffusion WebUI running in Docker on Ubuntu. This setup provides flexibility for access from your local network, integration with Pi-hole for easy access across devices, and compatibility with WSL for Windows users.&lt;/p&gt;&lt;p&gt;By following the security recommendations, your installation should be reasonably protected against unauthorized access. The data persistence configuration ensures that your models, configurations, and generated images are safely stored and can be backed up.&lt;/p&gt;&lt;p&gt;For the latest updates and enhancements, regularly check the official Automatic1111 repository and consider contributing to the open-source community that makes these incredible AI tools accessible to everyone.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide to Installing and Securing Tabby AI Coding Assistant on Windows with WSL2 and Docker</title><link>https://diylabhub.com/comprehensive-guide-to-installing-and-securing-tabby-ai-coding-assistant-on-windows-with-wsl2-and-docker/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-installing-and-securing-tabby-ai-coding-assistant-on-windows-with-wsl2-and-docker/</guid><pubDate>Fri, 14 Mar 2025 18:01:04 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Tabby is a self-hosted AI coding assistant that serves as a free, open-source alternative to GitHub Copilot. This guide will walk you through installing and configuring Tabby on Windows using WSL2 and Docker - the most efficient setup method that ensures your code stays private and secure.&lt;/p&gt;&lt;h2 id=&quot;introduction-to-tabby-ai-coding-assistant&quot;&gt;Introduction to Tabby AI Coding Assistant&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-to-tabby-ai-coding-assistant&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Tabby stands out as a powerful self-hosted AI coding assistant with several key advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Runs completely locally - your code never leaves your machine&lt;/li&gt;&lt;li&gt;No external databases or cloud services needed&lt;/li&gt;&lt;li&gt;OpenAPI interface for easy integration with coding environments&lt;/li&gt;&lt;li&gt;Support for consumer-grade GPUs (especially NVIDIA) for better performance&lt;/li&gt;&lt;li&gt;Compatible with various coding language models&lt;/li&gt;&lt;li&gt;Works offline and gives you complete control over your data&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Untitled-diagram-2025-03-15-031841-598x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before we start, make sure your system meets these requirements:&lt;/p&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Verify your hardware meets these minimum specifications:
# - CPU: Modern multi-core processor (i5/i7/i9 or AMD equivalent)
# - RAM: 8GB minimum, 16GB or more recommended
# - Storage: At least 50GB free space for Docker images and models
# - GPU: NVIDIA GPU with 4GB+ VRAM for GPU acceleration (optional but recommended)
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The hardware needs depend on which AI models you&amp;#39;ll use. For CPU-only operation, a modern processor with 8GB RAM works, but performance will be slower. For best results, an NVIDIA GPU with at least 4GB VRAM is recommended.&lt;/p&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Required software components:
# - Windows 10 version 2004+ or Windows 11
# - WSL2 (Windows Subsystem for Linux)
# - Ubuntu 20.04 or newer on WSL2
# - Docker Desktop with WSL2 integration
# - NVIDIA GPU drivers (if using GPU acceleration)
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;step-1-setting-up-wsl2-on-windows&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Setting Up WSL2 on Windows&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-setting-up-wsl2-on-windows&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;First, let&amp;#39;s set up WSL2:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Open PowerShell as Administrator and run:
wsl --install
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs WSL2 with Ubuntu as the default distribution. Reboot your system when prompted.&lt;/p&gt;&lt;p&gt;To verify your WSL version or update to WSL2:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check WSL version
wsl -l -v

# If not version 2, update with:
wsl --set-version Ubuntu 2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After installation and reboot, open Ubuntu from the Start menu to complete setup. You&amp;#39;ll create a username and password for your Ubuntu environment.&lt;/p&gt;&lt;h2 id=&quot;step-2-installing-docker-desktop-with-wsl2-integration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Installing Docker Desktop with WSL2 Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-installing-docker-desktop-with-wsl2-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker Desktop provides the easiest way to run Docker on Windows with WSL2:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Download Docker Desktop from the official website
# https://www.docker.com/products/docker-desktop/

# During installation:
# 1. Ensure &amp;quot;Use WSL 2 instead of Hyper-V&amp;quot; is selected
# 2. Check &amp;quot;Enable WSL 2 Windows Features&amp;quot; if prompted
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After installation, configure WSL2 integration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# In Docker Desktop:
# 1. Go to Settings &amp;gt; Resources &amp;gt; WSL Integration
# 2. Enable integration with your Ubuntu distribution
# 3. Apply and restart Docker Desktop
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Docker is working in your WSL2 Ubuntu:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Open Ubuntu terminal and run:
docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see a message confirming Docker is working correctly.&lt;/p&gt;&lt;h2 id=&quot;step-3-setting-up-nvidia-container-toolkit-for-gpu-support&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Setting Up NVIDIA Container Toolkit (For GPU Support)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-setting-up-nvidia-container-toolkit-for-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you have an NVIDIA GPU and want better performance, install the NVIDIA Container Toolkit:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Open your Ubuntu WSL terminal and run:
# Verify your NVIDIA drivers are installed and working
nvidia-smi

# Add NVIDIA package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

# Update package lists
sudo apt update

# Install NVIDIA Container Toolkit
sudo apt install -y nvidia-docker2

# Restart Docker service
sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify the NVIDIA Container Toolkit is working:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Test NVIDIA GPU access within a Docker container
docker run --rm --gpus all nvidia/cuda:11.7.1-base-ubuntu20.04 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If successful, you&amp;#39;ll see your GPU information, similar to running &lt;code&gt;nvidia-smi&lt;/code&gt; directly.&lt;/p&gt;&lt;h2 id=&quot;step-4-installing-tabby-with-docker&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Installing Tabby with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-installing-tabby-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You have two options for installing Tabby:&lt;/p&gt;&lt;h3 id=&quot;option-1-using-docker-run-simple-approach&quot;&gt;Option 1: Using Docker Run (Simple Approach)&lt;a class=&quot;h-anchor&quot; href=&quot;#option-1-using-docker-run-simple-approach&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This method is straightforward and perfect for testing:&lt;/p&gt;&lt;h4 id=&quot;for-gpu-accelerated-installation&quot;&gt;For GPU-Accelerated Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#for-gpu-accelerated-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a directory for Tabby data
mkdir -p $HOME/.tabby

# Run Tabby with GPU acceleration
docker run -it --gpus all \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model StarCoder-1B --device cuda --chat-model Qwen2-1.5B-Instruct
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads the Tabby Docker image, maps port 8080 for web access, creates a persistent volume for data, and uses StarCoder-1B as the code completion model with GPU acceleration.&lt;/p&gt;&lt;h4 id=&quot;for-cpu-only-installation&quot;&gt;For CPU-Only Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#for-cpu-only-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a directory for Tabby data
mkdir -p $HOME/.tabby

# Run Tabby on CPU
docker run --entrypoint /opt/tabby/bin/tabby-cpu -it \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model StarCoder-1B --chat-model Qwen2-1.5B-Instruct
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The CPU version will be significantly slower but works without an NVIDIA GPU.&lt;/p&gt;&lt;h3 id=&quot;option-2-using-docker-compose-with-traefik-integration&quot;&gt;Option 2: Using Docker Compose with Traefik Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#option-2-using-docker-compose-with-traefik-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For a more production-ready setup with proper networking and security:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create required directories
mkdir -p ~/docker_data/tabby/data

# Create docker-compose.yml file
cat &amp;gt; ~/docker_data/tabby/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  tabby:
    image: tabbyml/tabby
    command: serve --model StarCoder-1B --device cuda --chat-model Qwen2-1.5B-Instruct
    restart: unless-stopped
    volumes:
      - ./data:/data
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.tabby.rule=Host(`tabby.yourdomain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.tabby.entrypoints=websecure&amp;quot;
      - &amp;quot;traefik.http.routers.tabby.tls.certresolver=letsencrypt&amp;quot;
      - &amp;quot;traefik.http.services.tabby.loadbalancer.server.port=8080&amp;quot;
    networks:
      - traefik_network

networks:
  traefik_network:
    external: true
EOF

# Start Tabby
cd ~/docker_data/tabby &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up Tabby with Traefik as a reverse proxy for HTTPS support. Replace &lt;code&gt;tabby.yourdomain.com&lt;/code&gt; with your actual domain.&lt;/p&gt;&lt;h2 id=&quot;step-5-setting-up-traefik-for-secure-access&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Setting Up Traefik for Secure Access&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-setting-up-traefik-for-secure-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Traefik provides HTTPS and authentication for secure access:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create directories for Traefik
mkdir -p ~/docker_data/traefik/config ~/docker_data/traefik/letsencrypt

# Create Traefik&amp;#39;s docker-compose.yml
cat &amp;gt; ~/docker_data/traefik/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  traefik:
    image: traefik:v2.10
    restart: unless-stopped
    ports:
      - &amp;quot;80:80&amp;quot;
      - &amp;quot;443:443&amp;quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config:/etc/traefik
      - ./letsencrypt:/letsencrypt
    networks:
      - traefik_network

networks:
  traefik_network:
    name: traefik_network
EOF

# Create Traefik configuration file
cat &amp;gt; ~/docker_data/traefik/config/traefik.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
entryPoints:
  web:
    address: &amp;quot;:80&amp;quot;
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: &amp;quot;:443&amp;quot;

providers:
  docker:
    endpoint: &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault: false
    network: traefik_network

certificatesResolvers:
  letsencrypt:
    acme:
      email: your-email@example.com
      storage: /letsencrypt/acme.json
      httpChallenge:
        entryPoint: web

api:
  dashboard: true
  insecure: false
EOF

# Start Traefik
cd ~/docker_data/traefik &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-email@example.com&lt;/code&gt; with your actual email for Let&amp;#39;s Encrypt notifications.&lt;/p&gt;&lt;h2 id=&quot;step-6-backup-and-monitoring&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Backup and Monitoring&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-backup-and-monitoring&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Set up regular backups for your Tabby data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a backup script
cat &amp;gt; ~/backup-tabby.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=~/tabby-backups
mkdir -p $BACKUP_DIR
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
tar -czf $BACKUP_DIR/tabby-data-$TIMESTAMP.tar.gz ~/docker_data/tabby/data
find $BACKUP_DIR -type f -mtime +30 -delete  # Keep 30 days of backups
EOF

chmod +x ~/backup-tabby.sh

# Add to crontab to run daily
(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * ~/backup-tabby.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a monitoring script to ensure Tabby stays running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a monitoring script
cat &amp;gt; ~/monitor-tabby.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
if ! docker ps | grep -q tabbyml/tabby; then
  cd ~/docker_data/tabby &amp;amp;&amp;amp; docker compose up -d
  echo &amp;quot;Tabby was down, restarting at $(date)&amp;quot; &amp;gt;&amp;gt; ~/tabby-monitor.log
fi
EOF

chmod +x ~/monitor-tabby.sh

# Add to crontab to run every 5 minutes
(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;*/5 * * * * ~/monitor-tabby.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;step-7-using-different-models&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Using Different Models&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-using-different-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Tabby supports various models with different performance characteristics:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Example using a different code completion model
docker run -it --gpus all \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model TabbyML/CodeLlama-7B --device cuda
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Common models include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;StarCoder-1B (default, balanced performance)&lt;/li&gt;&lt;li&gt;TabbyML/J-350M (smaller, faster on CPU)&lt;/li&gt;&lt;li&gt;TabbyML/CodeLlama-7B (larger, better suggestions but requires more VRAM)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Choose based on your hardware capabilities and performance needs.&lt;/p&gt;&lt;h2 id=&quot;step-8-vs-code-integration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;VS Code Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-vs-code-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To use Tabby with VS Code:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Install the Tabby extension from the VS Code marketplace&lt;/li&gt;&lt;li&gt;Configure the server URL:&lt;ul&gt;&lt;li&gt;Local: http://localhost:8080&lt;/li&gt;&lt;li&gt;Domain: https://tabby.yourdomain.com (if using Traefik)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;security-considerations-for-production-use&quot;&gt;Security Considerations for Production Use&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations-for-production-use&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For production deployments, implement these additional security measures:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# 1. Never expose Tabby directly to the internet; always use a reverse proxy like Traefik

# 2. Implement proper firewall rules in WSL2
sudo ufw allow ssh
sudo ufw allow 8080/tcp
sudo ufw enable

# 3. Keep all software updated
sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y

# 4. Use a non-root user in Docker
# Add this to your docker-compose.yml:
user: &amp;quot;1000:1000&amp;quot;

# 5. Implement automated backup solutions as shown earlier
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;nvidia-gpu-not-detected&quot;&gt;NVIDIA GPU Not Detected&lt;a class=&quot;h-anchor&quot; href=&quot;#nvidia-gpu-not-detected&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Verify virtualization is enabled in BIOS
# Verify NVIDIA drivers match in both Windows and WSL2
nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;docker-permission-issues&quot;&gt;Docker Permission Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-permission-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add your user to the docker group
sudo usermod -aG docker $USER
# Log out and back in for changes to take effect
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;wsl2-memory-usage-too-high&quot;&gt;WSL2 Memory Usage Too High&lt;a class=&quot;h-anchor&quot; href=&quot;#wsl2-memory-usage-too-high&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Edit or create &lt;code&gt;%UserProfile%\.wslconfig&lt;/code&gt; in Windows with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[wsl2]
memory=8GB
processors=4
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart WSL2 with &lt;code&gt;wsl --shutdown&lt;/code&gt; in PowerShell.&lt;/p&gt;&lt;h2 id=&quot;stopping-or-removing-tabby&quot;&gt;Stopping or Removing Tabby&lt;a class=&quot;h-anchor&quot; href=&quot;#stopping-or-removing-tabby&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you need to stop or completely remove Tabby:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For docker run method
docker stop $(docker ps -q --filter ancestor=tabbyml/tabby)
docker rm $(docker ps -aq --filter ancestor=tabbyml/tabby)

# For docker-compose method
cd ~/docker_data/tabby &amp;amp;&amp;amp; docker compose down
docker image rm tabbyml/tabby traefik:v2.10
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a comprehensive setup for Tabby AI Coding Assistant on Windows using WSL2 and Docker. This configuration provides:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A self-hosted AI coding assistant that keeps your code private&lt;/li&gt;&lt;li&gt;GPU acceleration for better performance (if available)&lt;/li&gt;&lt;li&gt;Secure access via HTTPS with Traefik&lt;/li&gt;&lt;li&gt;Regular backups and monitoring&lt;/li&gt;&lt;li&gt;Flexibility to use different AI models&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Whether you&amp;#39;re using Tabby for personal projects or in a team environment, this setup provides a robust foundation that can be customized to your specific needs.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide for Installing and Securing Meetily AI Meeting Note-Taker with Docker</title><link>https://diylabhub.com/comprehensive-guide-for-installing-and-securing-meetily-ai-meeting-note-taker-with-docker/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-for-installing-and-securing-meetily-ai-meeting-note-taker-with-docker/</guid><pubDate>Mon, 10 Mar 2025 04:04:38 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Meetily is a powerful, privacy-first AI meeting assistant that captures, transcribes, and summarizes meetings in real-time. Unlike cloud-based alternatives such as Otter.ai ($8.33/month) or Granola.ai ($18/month), Meetily processes your meeting data locally, ensuring complete control over your sensitive information.&lt;/p&gt;&lt;h3 id=&quot;key-benefits-of-self-hosting-meetily&quot;&gt;Key Benefits of Self-Hosting Meetily&lt;a class=&quot;h-anchor&quot; href=&quot;#key-benefits-of-self-hosting-meetily&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Complete data privacy&lt;/strong&gt; - All processing performed locally, ensuring sensitive meeting information never leaves your infrastructure&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cost-effective&lt;/strong&gt; - Freedom from subscription costs associated with cloud-based alternatives&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fully customizable&lt;/strong&gt; - Open-source nature allows you to modify or extend functionality as needed&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cross-platform compatibility&lt;/strong&gt; - Works with Google Meet, Zoom, Microsoft Teams, and other video conferencing platforms&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;Instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Meetily_AI_Meeting_Note-taker_BlogLayout-2025-03-10-125932-1024x865.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before you begin, ensure your system meets these requirements:&lt;/p&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;CPU&lt;/strong&gt;: At least 4 cores (more cores recommended for optimal transcription performance)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;RAM&lt;/strong&gt;: Minimum 8GB (16GB+ recommended, especially if using local LLMs)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Storage&lt;/strong&gt;: At least 10GB of free space (more if storing many meeting recordings)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GPU&lt;/strong&gt;: Optional but recommended for faster transcription processing&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: Ubuntu 20.04 LTS or newer&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Permissions&lt;/strong&gt;: sudo privileges on your system&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Internet Connection&lt;/strong&gt;: Required for downloading Docker images&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Ports 80 and 443&lt;/strong&gt;: Required for web access (if exposing Meetily externally)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Port 8000&lt;/strong&gt;: For Meetily backend API&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Port 3000&lt;/strong&gt;: For Meetily frontend (if not using a reverse proxy)&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;docker-installation-on-ubuntu-2004&quot;&gt;Docker Installation on Ubuntu 20.04+&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-installation-on-ubuntu-2004&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you already have Docker and Docker Compose installed, you can skip to the next section. Otherwise, follow these steps to install Docker on Ubuntu:&lt;/p&gt;&lt;h3 id=&quot;step-1-update-package-index-and-install-dependencies&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Package Index and Install Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-package-index-and-install-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates your system&amp;#39;s package database and installs necessary packages required for adding Docker&amp;#39;s repository.&lt;/p&gt;&lt;h3 id=&quot;step-2-add-dockers-official-gpg-key&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Docker&amp;#39;s Official GPG Key&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-add-dockers-official-gpg-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands download Docker&amp;#39;s official GPG key and set appropriate permissions.&lt;/p&gt;&lt;h3 id=&quot;step-3-set-up-the-docker-repository&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up the Docker Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-set-up-the-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds the Docker repository to your system&amp;#39;s sources list.&lt;/p&gt;&lt;h3 id=&quot;step-4-install-docker-engine-and-docker-compose-plugin&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Engine and Docker Compose Plugin&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-install-docker-engine-and-docker-compose-plugin&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Docker Engine, CLI, containerd runtime, and the Docker Compose plugin.&lt;/p&gt;&lt;h3 id=&quot;step-5-verify-docker-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Docker Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-verify-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If successful, you&amp;#39;ll see a message confirming that Docker is properly installed.&lt;/p&gt;&lt;h3 id=&quot;step-6-configure-docker-to-run-without-sudo-optional-but-recommended&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Docker to Run Without Sudo (Optional but Recommended)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-configure-docker-to-run-without-sudo-optional-but-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo groupadd docker
sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Log out and log back in for the changes to take effect. This allows you to run Docker commands without prefixing them with sudo.&lt;/p&gt;&lt;h2 id=&quot;installing-meetily-with-docker&quot;&gt;Installing Meetily with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-meetily-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Docker is set up, let&amp;#39;s install Meetily using Docker Compose for easy deployment and management.&lt;/p&gt;&lt;h3 id=&quot;step-1-create-directory-structure-for-meetily&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Directory Structure for Meetily&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-directory-structure-for-meetily&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/meetily/{data,config,transcripts}
cd ~/docker_data/meetily
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a dedicated directory structure for Meetily with separate folders for different types of data.&lt;/p&gt;&lt;h3 id=&quot;step-2-create-docker-compose-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Compose Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-docker-compose-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a docker-compose.yml file for Meetily:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/meetily/docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Paste the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3&amp;#39;

services:
  backend:
    image: zackriya/meetily-backend:latest
    container_name: meetily-backend
    restart: unless-stopped
    volumes:
      - ./data:/app/data
      - ./config:/app/config
      - ./transcripts:/app/transcripts
    ports:
      - &amp;quot;8000:8000&amp;quot;
    environment:
      - NODE_ENV=production
    networks:
      - meetily-network
      - proxy

  frontend:
    image: zackriya/meetily-frontend:latest
    container_name: meetily-frontend
    restart: unless-stopped
    depends_on:
      - backend
    ports:
      - &amp;quot;3000:3000&amp;quot;
    environment:
      - REACT_APP_API_URL=http://localhost:8000
    networks:
      - meetily-network
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.meetily.rule=Host(`meetily.yourdomain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.meetily.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.meetily.tls=true&amp;quot;
      - &amp;quot;traefik.http.services.meetily.loadbalancer.server.port=3000&amp;quot;

networks:
  meetily-network:
  proxy:
    external: true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit the text editor.&lt;/p&gt;&lt;h3 id=&quot;step-3-set-up-configuration-files&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Configuration Files&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-set-up-configuration-files&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create the transcription configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/meetily/config/transcription.json
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Paste the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;{
  &amp;quot;model&amp;quot;: &amp;quot;base&amp;quot;,
  &amp;quot;language&amp;quot;: &amp;quot;en&amp;quot;,
  &amp;quot;translate&amp;quot;: false,
  &amp;quot;cpuThreads&amp;quot;: 4,
  &amp;quot;batchSize&amp;quot;: 512
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit the text editor.&lt;/p&gt;&lt;p&gt;Create the LLM configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/meetily/config/llm.json
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Paste the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;{
  &amp;quot;provider&amp;quot;: &amp;quot;ollama&amp;quot;,
  &amp;quot;model&amp;quot;: &amp;quot;llama2&amp;quot;,
  &amp;quot;host&amp;quot;: &amp;quot;host.docker.internal&amp;quot;,
  &amp;quot;port&amp;quot;: 11434,
  &amp;quot;timeout&amp;quot;: 120
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit the text editor.&lt;/p&gt;&lt;h3 id=&quot;step-4-start-meetily-services&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Meetily Services&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-start-meetily-services&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/meetily
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts the Meetily containers in detached mode (running in the background).&lt;/p&gt;&lt;h3 id=&quot;step-5-verify-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-verify-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep meetily
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command should show both meetily-backend and meetily-frontend containers running.&lt;/p&gt;&lt;h2 id=&quot;securing-your-meetily-installation&quot;&gt;Securing Your Meetily Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-your-meetily-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;set-up-a-secure-backup-system&quot;&gt;Set Up a Secure Backup System&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-a-secure-backup-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, create a backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/meetily/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Paste the following:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
TIMESTAMP=$(date +&amp;quot;%Y%m%d_%H%M%S&amp;quot;)
BACKUP_DIR=~/meetily_backups
mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/meetily_backup_$TIMESTAMP.tar.gz -C ~/ docker_data/meetily
find $BACKUP_DIR -name &amp;quot;meetily_backup_*.tar.gz&amp;quot; -mtime +30 -delete
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x ~/docker_data/meetily/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set up a daily backup schedule:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * ~/docker_data/meetily/backup.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This schedules the backup to run every day at 2 AM.&lt;/p&gt;&lt;h3 id=&quot;configure-proper-file-permissions&quot;&gt;Configure Proper File Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-proper-file-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod -R 750 ~/docker_data/meetily/config
chmod -R 750 ~/docker_data/meetily/data
chmod -R 750 ~/docker_data/meetily/transcripts
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This restricts access to configuration and data directories, protecting sensitive information.&lt;/p&gt;&lt;h3 id=&quot;restore-from-backup&quot;&gt;Restore from Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#restore-from-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you need to restore from a backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop Meetily containers
cd ~/docker_data/meetily
docker compose down

# Restore from backup (replace the timestamp with your actual backup file)
tar -xzf ~/meetily_backups/meetily_backup_YYYYMMDD_HHMMSS.tar.gz -C ~/

# Restart Meetily
cd ~/docker_data/meetily
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Here are solutions to common issues you might encounter when running Meetily.&lt;/p&gt;&lt;h3 id=&quot;problem-transcription-not-working&quot;&gt;Problem: Transcription Not Working&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-transcription-not-working&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs meetily-backend | grep &amp;quot;transcription&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check if the transcription model is properly configured:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat ~/docker_data/meetily/config/transcription.json
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Adjust settings for your hardware:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/meetily/config/transcription.json
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;{
  &amp;quot;model&amp;quot;: &amp;quot;tiny&amp;quot;,
  &amp;quot;language&amp;quot;: &amp;quot;en&amp;quot;,
  &amp;quot;translate&amp;quot;: false,
  &amp;quot;cpuThreads&amp;quot;: 2,
  &amp;quot;batchSize&amp;quot;: 256
}
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Restart the backend service:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose restart meetily-backend
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;problem-connection-to-ollama-llm-not-working&quot;&gt;Problem: Connection to Ollama (LLM) Not Working&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-connection-to-ollama-llm-not-working&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs meetily-backend | grep &amp;quot;llm&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Ensure Ollama is running:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Update the LLM configuration:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/docker_data/meetily/config/llm.json
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Modify as needed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;{
  &amp;quot;provider&amp;quot;: &amp;quot;ollama&amp;quot;,
  &amp;quot;model&amp;quot;: &amp;quot;llama2&amp;quot;,
  &amp;quot;host&amp;quot;: &amp;quot;host.docker.internal&amp;quot;,
  &amp;quot;port&amp;quot;: 11434,
  &amp;quot;timeout&amp;quot;: 120
}
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Restart the backend service:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose restart meetily-backend
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-meetily&quot;&gt;Updating Meetily&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-meetily&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update Meetily to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/meetily
docker compose down
docker compose pull
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring-system-resources&quot;&gt;Monitoring System Resources&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-system-resources&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up basic monitoring of your Meetily containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stats meetily-backend meetily-frontend
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;regular-maintenance-tasks&quot;&gt;Regular Maintenance Tasks&lt;a class=&quot;h-anchor&quot; href=&quot;#regular-maintenance-tasks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Clean up old meeting data:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;find ~/docker_data/meetily/transcripts -type f -mtime +90 -delete
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes transcripts older than 90 days.&lt;/p&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Check container logs for issues:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# View recent logs
docker logs --tail=100 meetily-backend
docker logs --tail=100 meetily-frontend

# Follow logs in real-time
docker logs -f meetily-backend
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Set up automatic weekly container restart (helps prevent memory leaks):&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 3 * * 0 cd ~/docker_data/meetily &amp;amp;&amp;amp; docker compose restart&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This schedules a restart every Sunday at 3 AM.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You have successfully set up Meetily, a privacy-focused AI meeting assistant, using Docker on Ubuntu. This configuration provides a secure, self-hosted solution for transcribing and summarizing your meetings while maintaining complete control over your data.&lt;/p&gt;&lt;p&gt;By following the security practices outlined in this guide, you&amp;#39;ve ensured that your meeting data remains private and protected. The backup procedures will help safeguard against data loss, and the maintenance tasks will keep your system running smoothly.&lt;/p&gt;&lt;p&gt;Remember to periodically check for updates to both Meetily and your Docker environment to benefit from the latest features and security improvements. If you encounter issues not covered in this guide, consult the official Meetily documentation or reach out to the community for support.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing and Securing Tabby AI Coding Assistant on Ubuntu 20.04+</title><link>https://diylabhub.com/complete-guide-to-installing-and-securing-tabby-ai-coding-assistant-on-ubuntu-20-04/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-securing-tabby-ai-coding-assistant-on-ubuntu-20-04/</guid><pubDate>Mon, 10 Mar 2025 03:24:30 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Are you looking for a privacy-focused alternative to GitHub Copilot? Tabby is an open-source, self-hosted AI coding assistant that lets you maintain control over your code while enjoying advanced AI assistance. This comprehensive guide will walk you through installing Tabby on Ubuntu 20.04 or newer using Docker.&lt;/p&gt;&lt;h2 id=&quot;what-is-tabby-ai-coding-assistant&quot;&gt;What is Tabby AI Coding Assistant?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-is-tabby-ai-coding-assistant&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Tabby is a powerful self-contained AI coding assistant that helps developers write code more efficiently. Unlike proprietary alternatives, Tabby operates entirely on your local infrastructure, ensuring your code remains private and secure.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Self-contained operation with no external databases or cloud services&lt;/li&gt;&lt;li&gt;OpenAPI interface for integration with existing systems&lt;/li&gt;&lt;li&gt;Support for NVIDIA GPUs for faster performance (also works on CPU)&lt;/li&gt;&lt;li&gt;Compatible with various coding models including StarCoder, Code Llama, and others&lt;/li&gt;&lt;li&gt;Integrates with popular code editors (especially VS Code)&lt;/li&gt;&lt;li&gt;Provides intelligent code completion and answers to coding queries&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Tabby-AI-Coding-Assistant-Blog-Layout-2025-03-10-122025-720x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before we begin, make sure your system meets these requirements:&lt;/p&gt;&lt;h3 id=&quot;system-requirements&quot;&gt;System Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#system-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer&lt;/li&gt;&lt;li&gt;Minimum 8GB RAM (16GB+ recommended)&lt;/li&gt;&lt;li&gt;At least 30GB disk space for model data&lt;/li&gt;&lt;li&gt;For GPU acceleration: NVIDIA GPU with 4GB+ VRAM&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;update-your-system&quot;&gt;Update Your System&lt;a class=&quot;h-anchor&quot; href=&quot;#update-your-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, let&amp;#39;s update your Ubuntu system:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures all packages are current before installation.&lt;/p&gt;&lt;h3 id=&quot;install-basic-dependencies&quot;&gt;Install Basic Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#install-basic-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y curl wget git software-properties-common apt-transport-https ca-certificates gnupg lsb-release unzip
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These are essential utilities needed for the installation process.&lt;/p&gt;&lt;h3 id=&quot;install-docker&quot;&gt;Install Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker is required to run Tabby. Here&amp;#39;s how to install it:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Remove any old Docker installations
sudo apt remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes any conflicting previous Docker installations.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add Docker&amp;#39;s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds Docker&amp;#39;s GPG key for package verification.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add Docker repository
echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds the Docker repository to your system.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Update apt and install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Docker from the official repository.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add your user to the docker group
sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows you to run Docker without sudo.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Apply the new group membership
newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This activates the new group membership without requiring logout.&lt;/p&gt;&lt;p&gt;Verify your Docker installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker --version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the Docker version if installation was successful.&lt;/p&gt;&lt;h3 id=&quot;set-up-nvidia-container-toolkit-for-gpu-support&quot;&gt;Set Up NVIDIA Container Toolkit (For GPU Support)&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-nvidia-container-toolkit-for-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you plan to use GPU acceleration (recommended for better performance):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Verify your NVIDIA driver is installed
nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows your GPU information if drivers are properly installed.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Install NVIDIA Container Toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt install -y nvidia-docker2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the NVIDIA Container Toolkit for Docker.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Restart Docker service
sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This applies the new NVIDIA configuration.&lt;/p&gt;&lt;p&gt;Verify the NVIDIA Container Toolkit installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run --rm --gpus all nvidia/cuda:11.7.1-base-ubuntu20.04 nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This should display your GPU information, confirming Docker can access your GPU.&lt;/p&gt;&lt;h2 id=&quot;installation-options&quot;&gt;Installation Options&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-options&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;option-1-using-docker-run-simplest-approach&quot;&gt;Option 1: Using Docker Run (Simplest Approach)&lt;a class=&quot;h-anchor&quot; href=&quot;#option-1-using-docker-run-simplest-approach&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;gpu-installation-nvidia&quot;&gt;GPU Installation (NVIDIA)&lt;a class=&quot;h-anchor&quot; href=&quot;#gpu-installation-nvidia&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;For systems with NVIDIA GPUs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p $HOME/.tabby
docker run -it --gpus all \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model StarCoder-1B --device cuda --chat-model Qwen2-1.5B-Instruct
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Creates a directory for Tabby data&lt;/li&gt;&lt;li&gt;Runs Tabby with GPU acceleration&lt;/li&gt;&lt;li&gt;Maps port 8080 for web access&lt;/li&gt;&lt;li&gt;Mounts a local directory for data persistence&lt;/li&gt;&lt;li&gt;Uses StarCoder-1B for code completion and Qwen2-1.5B-Instruct for chat&lt;/li&gt;&lt;/ol&gt;&lt;h4 id=&quot;cpu-only-installation&quot;&gt;CPU-Only Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#cpu-only-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;If you don&amp;#39;t have a GPU:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p $HOME/.tabby
docker run --entrypoint /opt/tabby/bin/tabby-cpu -it \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model StarCoder-1B
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This uses the CPU-optimized entry point. Note that performance will be significantly slower than with GPU acceleration.&lt;/p&gt;&lt;h3 id=&quot;option-2-using-docker-compose-better-for-production&quot;&gt;Option 2: Using Docker Compose (Better for Production)&lt;a class=&quot;h-anchor&quot; href=&quot;#option-2-using-docker-compose-better-for-production&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create necessary directories and files:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/tabby/data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory structure for your Tabby deployment.&lt;/p&gt;&lt;p&gt;Access Tabby at http://localhost:8080 or your configured domain.&lt;/p&gt;&lt;h2 id=&quot;verification-and-testing&quot;&gt;Verification and Testing&lt;a class=&quot;h-anchor&quot; href=&quot;#verification-and-testing&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Verify that Tabby is running correctly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check if the container is running
docker ps | grep tabby
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows if the Tabby container is active.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check the logs for any errors
docker logs tabby
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This displays container logs to help identify issues.&lt;/p&gt;&lt;h2 id=&quot;ide-integration&quot;&gt;IDE Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#ide-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Tabby works best with code editors. For VS Code:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Open VS Code&lt;/li&gt;&lt;li&gt;Go to Extensions (Ctrl+Shift+X)&lt;/li&gt;&lt;li&gt;Search for &amp;quot;Tabby&amp;quot;&lt;/li&gt;&lt;li&gt;Install the TabbyML extension&lt;/li&gt;&lt;li&gt;Open VS Code settings (Ctrl+,)&lt;/li&gt;&lt;li&gt;Search for &amp;quot;Tabby&amp;quot;&lt;/li&gt;&lt;li&gt;Set &amp;quot;Tabby: Server Url&amp;quot; to your Tabby server (e.g., http://localhost:8080)&lt;/li&gt;&lt;li&gt;Restart VS Code&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;You should now see Tabby suggestions as you code.&lt;/p&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;problem-docker-container-fails-to-start-with-gpu-support&quot;&gt;Problem: Docker Container Fails to Start with GPU Support&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-docker-container-fails-to-start-with-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt; Error message containing: &lt;code&gt;Error response from daemon: could not select device driver &amp;quot;&amp;quot; with capabilities: [[gpu]]&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Reinstall NVIDIA Container Toolkit:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Reinstall NVIDIA Container Toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt install -y nvidia-docker2

# Restart Docker
sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This reinstalls and reconfigures the NVIDIA Container Toolkit.&lt;/p&gt;&lt;p&gt;If NVIDIA driver is missing:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install nvidia-driver-525  # Use the latest recommended version
sudo reboot
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs NVIDIA drivers needed for GPU support.&lt;/p&gt;&lt;h3 id=&quot;problem-model-download-failures&quot;&gt;Problem: Model Download Failures&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-model-download-failures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt; Container starts but fails during model downloading.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Check for network issues or insufficient disk space:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check available disk space
df -h
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows available disk space on your system.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# If disk space is low, clear Docker unused resources
docker system prune -a
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes unused Docker resources to free up space.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Ensure the data directory has correct permissions
chmod -R 777 $HOME/.tabby  # Temporarily for troubleshooting
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This temporarily sets permissive permissions for debugging.&lt;/p&gt;&lt;h3 id=&quot;problem-slow-performance-with-cpu-only-mode&quot;&gt;Problem: Slow Performance with CPU-Only Mode&lt;a class=&quot;h-anchor&quot; href=&quot;#problem-slow-performance-with-cpu-only-mode&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt; Tabby is running but code completions are very slow.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; CPU-only mode is significantly slower than GPU mode. Consider:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Use a smaller model for better CPU performance:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --entrypoint /opt/tabby/bin/tabby-cpu -it \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model TabbyML/J-350M  # Smaller model better for CPU
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Smaller models run faster on CPU but may provide less accurate suggestions.&lt;/p&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-tabby&quot;&gt;Updating Tabby&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-tabby&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update Tabby to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For Docker run method
docker pull tabbyml/tabby
# Then restart your container with the same run command

# For Docker Compose method
cd ~/docker_data/tabby
docker compose pull
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls the latest Tabby image and restarts your container.&lt;/p&gt;&lt;h3 id=&quot;backing-up-data&quot;&gt;Backing Up Data&lt;a class=&quot;h-anchor&quot; href=&quot;#backing-up-data&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/backup-tabby.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=~/tabby-backups
mkdir -p $BACKUP_DIR
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
tar -czf $BACKUP_DIR/tabby-data-$TIMESTAMP.tar.gz ~/docker_data/tabby/data
# Keep only the latest 5 backups
ls -t $BACKUP_DIR/tabby-data-*.tar.gz | tail -n +6 | xargs rm -f
EOF

chmod +x ~/backup-tabby.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a script that makes compressed backups of your Tabby data.&lt;/p&gt;&lt;p&gt;Add a scheduled backup task:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * ~/backup-tabby.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up daily backups at 2:00 AM.&lt;/p&gt;&lt;h3 id=&quot;restoring-from-backup&quot;&gt;Restoring from Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#restoring-from-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop the container
cd ~/docker_data/tabby &amp;amp;&amp;amp; docker compose down

# Restore from backup
tar -xzf ~/tabby-backups/tabby-data-20250310-120000.tar.gz -C /

# Restart the container
cd ~/docker_data/tabby &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This restores your Tabby data from a backup archive.&lt;/p&gt;&lt;h2 id=&quot;advanced-configuration&quot;&gt;Advanced Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For advanced users, Tabby offers additional options:&lt;/p&gt;&lt;h3 id=&quot;using-different-models&quot;&gt;Using Different Models&lt;a class=&quot;h-anchor&quot; href=&quot;#using-different-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Tabby supports various models with different capabilities:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Example using a different code completion model
docker run -it --gpus all \
  -p 8080:8080 -v $HOME/.tabby:/data \
  tabbyml/tabby \
  serve --model TabbyML/CodeLlama-7B --device cuda
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This uses the larger CodeLlama-7B model for potentially better suggestions (requires more VRAM).&lt;/p&gt;&lt;p&gt;Common models include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;StarCoder-1B (default, balanced performance)&lt;/li&gt;&lt;li&gt;TabbyML/J-350M (smaller, faster on CPU)&lt;/li&gt;&lt;li&gt;TabbyML/CodeLlama-7B (larger, better suggestions but requires more VRAM)&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully functional Tabby AI Coding Assistant installation on your Ubuntu system! This self-hosted solution gives you complete control over your code and development environment while still providing advanced AI-powered assistance.&lt;/p&gt;&lt;p&gt;For the best experience:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Use GPU acceleration if available&lt;/li&gt;&lt;li&gt;Choose models appropriate for your hardware&lt;/li&gt;&lt;li&gt;Keep your installation updated&lt;/li&gt;&lt;li&gt;Maintain regular backups&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Whether you&amp;#39;re a solo developer or working in a team, Tabby provides a privacy-focused alternative to cloud-based coding assistants that can significantly boost your productivity.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Installing and Securing Jan: The Offline ChatGPT Alternative on Ubuntu 20.04 with Docker</title><link>https://diylabhub.com/installing-and-securing-jan-the-offline-chatgpt-alternative-on-ubuntu-20-04-with-docker/</link><guid isPermaLink="true">https://diylabhub.com/installing-and-securing-jan-the-offline-chatgpt-alternative-on-ubuntu-20-04-with-docker/</guid><pubDate>Mon, 10 Mar 2025 03:02:37 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Jan is a powerful open-source alternative to ChatGPT that runs 100% offline on your computer. This privacy-focused AI assistant ensures your conversations never leave your system, giving you complete control over your data. In this guide, we&amp;#39;ll walk through installing, configuring, and securing Jan on Ubuntu 20.04 (and newer) using Docker.&lt;/p&gt;&lt;h3 id=&quot;key-benefits-of-jan&quot;&gt;Key Benefits of Jan&lt;a class=&quot;h-anchor&quot; href=&quot;#key-benefits-of-jan&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;100% Offline Operation&lt;/strong&gt;: All data and conversations remain on your local device&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Multiple AI Engine Support&lt;/strong&gt;: Compatible with llama.cpp and TensorRT-LLM&lt;/li&gt;&lt;li&gt;&lt;strong&gt;OpenAI-Compatible API&lt;/strong&gt;: Accessible at localhost:1337&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cross-Platform Design&lt;/strong&gt;: Works on various hardware from personal computers to multi-GPU clusters&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Privacy-First Approach&lt;/strong&gt;: Perfect for handling sensitive information&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Installing-and-Securing-Jan_-The-Offline-2025-03-10-115801-865x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before we begin, make sure your system meets these requirements:&lt;/p&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;At least 2 CPU cores and 2 GB of RAM (more recommended for better performance)&lt;/li&gt;&lt;li&gt;For GPU acceleration (optional but recommended):&lt;ul&gt;&lt;li&gt;NVIDIA GPU with CUDA Toolkit 11.7 or higher&lt;/li&gt;&lt;li&gt;NVIDIA driver 470.63.01 or higher&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer&lt;/li&gt;&lt;li&gt;glibc 2.27 or higher (check with &lt;code&gt;ldd --version&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;gcc 11, g++ 11, cpp 11 or higher&lt;/li&gt;&lt;li&gt;Docker Engine and Docker Compose&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Local port 1337 available for Jan&amp;#39;s API server&lt;/li&gt;&lt;li&gt;Internet access for initial setup and model downloads (after setup, Jan works offline)&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;step-1-install-docker-on-ubuntu-2004&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker on Ubuntu 20.04&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-docker-on-ubuntu-2004&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker is required to run Jan in container mode. Let&amp;#39;s follow the official method to install Docker Engine.&lt;/p&gt;&lt;h3 id=&quot;remove-existing-docker-installations&quot;&gt;Remove existing Docker installations&lt;a class=&quot;h-anchor&quot; href=&quot;#remove-existing-docker-installations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes any previous Docker installations that might conflict with the new one.&lt;/p&gt;&lt;h3 id=&quot;set-up-the-docker-repository&quot;&gt;Set up the Docker repository&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-the-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs packages needed for apt to use repositories over HTTPS.&lt;/p&gt;&lt;h3 id=&quot;add-dockers-official-gpg-key&quot;&gt;Add Docker&amp;#39;s official GPG key&lt;a class=&quot;h-anchor&quot; href=&quot;#add-dockers-official-gpg-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Adds Docker&amp;#39;s GPG key to verify package integrity.&lt;/p&gt;&lt;h3 id=&quot;add-the-docker-repository&quot;&gt;Add the Docker repository&lt;a class=&quot;h-anchor&quot; href=&quot;#add-the-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo add-apt-repository &amp;quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Adds the Docker repository to your package sources. The command automatically detects your Ubuntu version.&lt;/p&gt;&lt;h3 id=&quot;install-docker-engine&quot;&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Updates the package index and installs Docker Engine with related tools.&lt;/p&gt;&lt;h3 id=&quot;verify-docker-installation&quot;&gt;Verify Docker installation&lt;a class=&quot;h-anchor&quot; href=&quot;#verify-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verifies Docker is correctly installed by running a test container. You should see a success message if everything works properly.&lt;/p&gt;&lt;h2 id=&quot;step-2-configure-docker-for-enhanced-security-rootless-mode&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Docker for Enhanced Security (Rootless Mode)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-configure-docker-for-enhanced-security-rootless-mode&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For improved security, let&amp;#39;s run Docker in rootless mode, which reduces potential risks by running the Docker daemon and containers as a non-root user.&lt;/p&gt;&lt;h3 id=&quot;install-rootless-prerequisites&quot;&gt;Install rootless prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#install-rootless-prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get install -y uidmap dbus-user-session
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs packages needed for rootless Docker operation.&lt;/p&gt;&lt;h3 id=&quot;set-up-rootless-docker&quot;&gt;Set up rootless Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-rootless-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl disable --now docker.service docker.socket
sudo apt-get install -y docker-ce-rootless-extras
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Disables the system-wide Docker service and installs rootless extras.&lt;/p&gt;&lt;h3 id=&quot;run-the-rootless-setup-tool&quot;&gt;Run the rootless setup tool&lt;a class=&quot;h-anchor&quot; href=&quot;#run-the-rootless-setup-tool&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;dockerd-rootless-setuptool.sh install
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Configures Docker to run in rootless mode.&lt;/p&gt;&lt;h3 id=&quot;add-environment-variables-to-your-shell-profile&quot;&gt;Add environment variables to your shell profile&lt;a class=&quot;h-anchor&quot; href=&quot;#add-environment-variables-to-your-shell-profile&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;#39;export PATH=/usr/bin:$PATH&amp;#39; &amp;gt;&amp;gt; ~/.bashrc
echo &amp;#39;export DOCKER_HOST=unix:///run/user/1000/docker.sock&amp;#39; &amp;gt;&amp;gt; ~/.bashrc
source ~/.bashrc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Sets required environment variables for rootless Docker. &lt;strong&gt;Note&lt;/strong&gt;: Replace 1000 with your actual user ID if different.&lt;/p&gt;&lt;h3 id=&quot;enable-docker-service-at-startup&quot;&gt;Enable Docker service at startup&lt;a class=&quot;h-anchor&quot; href=&quot;#enable-docker-service-at-startup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;systemctl --user enable docker
sudo loginctl enable-linger $(whoami)
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Configures Docker to start automatically with your system.&lt;/p&gt;&lt;h2 id=&quot;step-3-create-a-docker-compose-configuration-for-jan&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Docker Compose Configuration for Jan&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-a-docker-compose-configuration-for-jan&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Docker is installed and configured securely, let&amp;#39;s set up Jan using Docker Compose.&lt;/p&gt;&lt;h3 id=&quot;create-a-directory-structure-for-jan&quot;&gt;Create a directory structure for Jan&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-directory-structure-for-jan&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/jan/data ~/docker_data/jan/config
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates directories for Jan&amp;#39;s data and configuration files.&lt;/p&gt;&lt;h3 id=&quot;create-a-docker-compose-file&quot;&gt;Create a Docker Compose file&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/jan/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  jan:
    container_name: jan
    image: janhq/jan:latest
    restart: unless-stopped
    ports:
      - &amp;quot;1337:1337&amp;quot;
    volumes:
      - ./data:/data
      - ./config:/root/.jan
    environment:
      - JAN_HOST=0.0.0.0
      - JAN_PORT=1337
    # Uncomment the following lines for GPU support
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: all
    #           capabilities: [gpu]
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a Docker Compose configuration file for Jan.&lt;/p&gt;&lt;h3 id=&quot;launch-jan&quot;&gt;Launch Jan&lt;a class=&quot;h-anchor&quot; href=&quot;#launch-jan&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/jan
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Starts the Jan container in detached mode.&lt;/p&gt;&lt;h3 id=&quot;access-jan-api&quot;&gt;Access Jan API&lt;a class=&quot;h-anchor&quot; href=&quot;#access-jan-api&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl http://localhost:1337/v1/models
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verifies that Jan&amp;#39;s API is accessible. You should see a response listing available models.&lt;/p&gt;&lt;h2 id=&quot;step-4-set-up-automatic-backups&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Automatic Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-set-up-automatic-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;#39;s create a backup script to ensure your data is safe.&lt;/p&gt;&lt;h3 id=&quot;create-a-backup-script&quot;&gt;Create a backup script&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/jan/backup-jan.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash

TIMESTAMP=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR=~/jan_backups

mkdir -p $BACKUP_DIR
cd ~/docker_data/jan

# Ensure Jan is running
docker compose ps | grep jan || docker compose up -d

# Create backup archive
tar -czf $BACKUP_DIR/jan_backup_$TIMESTAMP.tar.gz data config

# Remove backups older than 30 days
find $BACKUP_DIR -name &amp;quot;jan_backup_*.tar.gz&amp;quot; -type f -mtime +30 -delete

echo &amp;quot;Backup completed: $BACKUP_DIR/jan_backup_$TIMESTAMP.tar.gz&amp;quot;
EOF

chmod +x ~/docker_data/jan/backup-jan.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a backup script that archives Jan&amp;#39;s data and configuration files.&lt;/p&gt;&lt;h3 id=&quot;schedule-automatic-backups&quot;&gt;Schedule automatic backups&lt;a class=&quot;h-anchor&quot; href=&quot;#schedule-automatic-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * ~/docker_data/jan/backup-jan.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Schedules a backup every day at 2 AM.&lt;/p&gt;&lt;h2 id=&quot;common-problems-and-troubleshooting&quot;&gt;Common Problems and Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Here are solutions for issues you might encounter:&lt;/p&gt;&lt;h3 id=&quot;issue-docker-fails-to-start&quot;&gt;Issue: Docker fails to start&lt;a class=&quot;h-anchor&quot; href=&quot;#issue-docker-fails-to-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;systemctl --user status docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;systemctl --user restart docker
sudo loginctl enable-linger $(whoami)
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restarts the Docker service and ensures it&amp;#39;s configured to start automatically.&lt;/p&gt;&lt;h3 id=&quot;issue-jan-api-is-unreachable&quot;&gt;Issue: Jan API is unreachable&lt;a class=&quot;h-anchor&quot; href=&quot;#issue-jan-api-is-unreachable&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -v http://localhost:1337/v1/models
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/jan &amp;amp;&amp;amp; docker compose down
cd ~/docker_data/jan &amp;amp;&amp;amp; docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restarts the Jan container to resolve connectivity issues.&lt;/p&gt;&lt;h3 id=&quot;issue-gpu-acceleration-not-working&quot;&gt;Issue: GPU acceleration not working&lt;a class=&quot;h-anchor&quot; href=&quot;#issue-gpu-acceleration-not-working&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it jan nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; If you get an error, ensure NVIDIA Docker support is installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install -y nvidia-container-toolkit
systemctl --user restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs the NVIDIA Container Toolkit and restarts Docker to enable GPU support.&lt;/p&gt;&lt;h3 id=&quot;issue-model-download-failures&quot;&gt;Issue: Model download failures&lt;a class=&quot;h-anchor&quot; href=&quot;#issue-model-download-failures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it jan /bin/bash -c &amp;quot;mkdir -p /data/models &amp;amp;&amp;amp; chmod 777 /data/models&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Ensures the models directory exists and has proper permissions.&lt;/p&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-jan&quot;&gt;Updating Jan&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-jan&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update Jan to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/jan
docker compose pull
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Pulls the latest Jan image, stops the current container, and starts a new one with the updated image.&lt;/p&gt;&lt;h3 id=&quot;monitoring-jan&quot;&gt;Monitoring Jan&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-jan&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up basic monitoring for Jan:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/jan/monitor-jan.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash

API_URL=&amp;quot;http://localhost:1337/v1/models&amp;quot;
LOG_FILE=~/jan_monitor.log

echo &amp;quot;$(date) - Checking Jan service...&amp;quot; &amp;gt;&amp;gt; $LOG_FILE

# Check if API is responding
if curl -s -f $API_URL &amp;gt; /dev/null; then
    echo &amp;quot;$(date) - Jan is running correctly.&amp;quot; &amp;gt;&amp;gt; $LOG_FILE
else
    echo &amp;quot;$(date) - ERROR: Jan is not responding. Attempting restart...&amp;quot; &amp;gt;&amp;gt; $LOG_FILE
    cd ~/docker_data/jan
    docker compose restart
    
    # Check if restart fixed the issue
    if curl -s -f $API_URL &amp;gt; /dev/null; then
        echo &amp;quot;$(date) - Jan successfully restarted.&amp;quot; &amp;gt;&amp;gt; $LOG_FILE
    else
        echo &amp;quot;$(date) - CRITICAL: Jan failed to restart. Manual intervention required.&amp;quot; &amp;gt;&amp;gt; $LOG_FILE
        # Optionally send an email alert here
    fi
fi
EOF

chmod +x ~/docker_data/jan/monitor-jan.sh
(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;*/10 * * * * ~/docker_data/jan/monitor-jan.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a monitoring script that checks Jan&amp;#39;s status every 10 minutes and attempts to restart it if issues are detected.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;By following this guide, you&amp;#39;ve successfully installed, secured, and configured Jan on Ubuntu 20.04 using Docker. You now have access to a powerful AI assistant that runs completely offline, respecting your privacy and giving you full control over your data.&lt;/p&gt;&lt;p&gt;The Docker-based deployment provides a clean, isolated environment for Jan, while security measures like rootless Docker help protect your system. The automatic backup and monitoring solutions ensure your setup remains reliable over time.&lt;/p&gt;&lt;p&gt;Remember that Jan is actively developed, with new features and improvements being added regularly. Keep an eye on the &lt;a href=&quot;https://jan.ai/docs&quot;&gt;official documentation&lt;/a&gt; and &lt;a href=&quot;https://github.com/janhq/jan&quot;&gt;GitHub repository&lt;/a&gt; for updates and additional configuration options.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide to Hosting and Securing Jellyfin on Ubuntu 20.04+ with Docker</title><link>https://diylabhub.com/comprehensive-guide-to-hosting-and-securing-jellyfin-on-ubuntu-20-04-with-docker/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-hosting-and-securing-jellyfin-on-ubuntu-20-04-with-docker/</guid><pubDate>Sun, 09 Mar 2025 23:29:12 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction:&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Jellyfin is a free and open-source media server that allows you to manage and stream your media collection to any device. Unlike proprietary alternatives like Plex or Emby, Jellyfin is completely free, has no premium features locked behind paywalls, and doesn&amp;#39;t collect user data. This guide will walk you through every step of setting up a secure, well-configured Jellyfin instance on Ubuntu 20.04 or newer using Docker.&lt;/p&gt;&lt;h2 id=&quot;why-use-docker-for-jellyfin&quot;&gt;Why Use Docker for Jellyfin?&lt;a class=&quot;h-anchor&quot; href=&quot;#why-use-docker-for-jellyfin&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker deployment offers several key advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Simplified installation process&lt;/li&gt;&lt;li&gt;Consistent environments across different systems&lt;/li&gt;&lt;li&gt;Easy updates without dependency conflicts&lt;/li&gt;&lt;li&gt;Enhanced security through container isolation&lt;/li&gt;&lt;li&gt;Simplified backup and restore procedures&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;Instruction layout/flow&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Jellyfin-Post-blog-Layout-2025-03-10-082349-1009x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before proceeding with installation, ensure your system meets these requirements:&lt;/p&gt;&lt;h3 id=&quot;system-requirements&quot;&gt;System Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#system-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer&lt;/li&gt;&lt;li&gt;2GB RAM minimum (4GB recommended for transcoding)&lt;/li&gt;&lt;li&gt;Dual-core CPU minimum (quad-core recommended for transcoding)&lt;/li&gt;&lt;li&gt;Sufficient storage for your media library&lt;/li&gt;&lt;li&gt;Network connectivity (port forwarding required for remote access)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You can check your Ubuntu version with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;lsb_release -a
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Docker Engine&lt;/li&gt;&lt;li&gt;Docker Compose&lt;/li&gt;&lt;li&gt;Git (optional, for cloning configuration files)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;required-permissions&quot;&gt;Required Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#required-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You&amp;#39;ll need:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Sudo access for installation&lt;/li&gt;&lt;li&gt;User added to docker group for non-root Docker access&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Check your current user ID and group ID (needed for Docker configuration):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#command is: id
id
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;installing-docker-and-docker-compose&quot;&gt;Installing Docker and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-docker-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Follow these steps to install Docker and Docker Compose on your Ubuntu system:&lt;/p&gt;&lt;h3 id=&quot;step-1-update-system-packages&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update System Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-system-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures your system has the latest security updates before proceeding.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-required-dependencies&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Required Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-required-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages are necessary for adding Docker&amp;#39;s repository and securely downloading packages.&lt;/p&gt;&lt;h3 id=&quot;step-3-add-dockers-official-gpg-key&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Docker&amp;#39;s Official GPG Key&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-add-dockers-official-gpg-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds Docker&amp;#39;s official GPG key to verify package integrity.&lt;/p&gt;&lt;h3 id=&quot;step-4-add-docker-repository&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Docker Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-add-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds Docker&amp;#39;s official repository to your system&amp;#39;s package sources.&lt;/p&gt;&lt;h3 id=&quot;step-5-update-package-database&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Package Database&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-update-package-database&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This refreshes your package database to include Docker packages.&lt;/p&gt;&lt;h3 id=&quot;step-6-install-docker-engine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install docker-ce docker-ce-cli containerd.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Docker Engine, CLI, and containerd.&lt;/p&gt;&lt;h3 id=&quot;step-7-enable-docker-service&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enable Docker Service&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-enable-docker-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl enable --now docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts Docker and configures it to launch at system boot.&lt;/p&gt;&lt;h3 id=&quot;step-8-add-user-to-docker-group&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add User to Docker Group&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-add-user-to-docker-group&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows running Docker commands without sudo. &lt;strong&gt;Important:&lt;/strong&gt; You&amp;#39;ll need to log out and back in for changes to take effect.&lt;/p&gt;&lt;h3 id=&quot;step-9-install-docker-compose&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#step-9-install-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo curl -L &amp;quot;https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)&amp;quot; -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads the latest Docker Compose binary and makes it executable.&lt;/p&gt;&lt;h3 id=&quot;step-10-verify-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 10&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-10-verify-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker --version
docker-compose --version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This confirms that both Docker and Docker Compose are correctly installed.&lt;/p&gt;&lt;h2 id=&quot;setting-up-jellyfin-with-docker-compose&quot;&gt;Setting Up Jellyfin with Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-jellyfin-with-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Docker is installed, we&amp;#39;ll set up Jellyfin using Docker Compose for easier management of container configurations.&lt;/p&gt;&lt;h3 id=&quot;step-1-create-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/jellyfin/{config,cache,media}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates directories for Jellyfin&amp;#39;s configuration, cache, and media files.&lt;/p&gt;&lt;h3 id=&quot;step-2-create-docker-compose-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Compose Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-docker-compose-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a new file at &lt;code&gt;~/docker_data/jellyfin/docker-compose.yml&lt;/code&gt; with the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/jellyfin/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    user: 1000:1000  # Replace with your user ID and group ID from &amp;#39;id&amp;#39; command
    restart: unless-stopped
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./media:/media
      # Optional: mount additional media locations
      # - /path/to/media:/media2:ro
    ports:
      - 8096:8096  # HTTP port (remove for Traefik-only access)
    environment:
      - TZ=Etc/UTC  # Set to your timezone
    networks:
      - proxy  # For Traefik integration
    #devices:  # Uncomment for hardware acceleration
    #  - /dev/dri:/dev/dri  # Intel GPU
    #  - /dev/video10:/dev/video10  # VAAPI rendering node
    #  - /dev/video11:/dev/video11  # VAAPI DRM node
    #  - /dev/nvidia0:/dev/nvidia0  # Nvidia GPU
    #  - /dev/nvidiactl:/dev/nvidiactl
    #  - /dev/nvidia-modeset:/dev/nvidia-modeset
    #  - /dev/nvidia-uvm:/dev/nvidia-uvm
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.jellyfin.rule=Host(`jellyfin.your-domain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.jellyfin.entrypoints=websecure&amp;quot;
      - &amp;quot;traefik.http.routers.jellyfin.tls.certresolver=letsencrypt&amp;quot;
      - &amp;quot;traefik.http.services.jellyfin.loadbalancer.server.port=8096&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Replace &lt;code&gt;1000:1000&lt;/code&gt; with your actual user ID and group ID from the &lt;code&gt;id&lt;/code&gt; command, and &lt;code&gt;jellyfin.your-domain.com&lt;/code&gt; with your actual domain.&lt;/p&gt;&lt;h2 id=&quot;setting-up-traefik-as-a-reverse-proxy-optional-but-recommended&quot;&gt;Setting Up Traefik as a Reverse Proxy (Optional but Recommended)&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-traefik-as-a-reverse-proxy-optional-but-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Traefik provides secure access to Jellyfin from the internet with automatic SSL certificate management.&lt;/p&gt;&lt;h3 id=&quot;step-1-create-traefik-directory-structure&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Traefik Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-traefik-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/traefik/{config,letsencrypt}
touch ~/docker_data/traefik/acme.json
chmod 600 ~/docker_data/traefik/acme.json
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates directories for Traefik configuration and Let&amp;#39;s Encrypt certificates.&lt;/p&gt;&lt;h3 id=&quot;step-2-create-traefik-configuration-files&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Traefik Configuration Files&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-traefik-configuration-files&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create the main configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/traefik/config/traefik.toml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
[entryPoints]
  [entryPoints.web]
    address = &amp;quot;:80&amp;quot;
    [entryPoints.web.http.redirections.entryPoint]
      to = &amp;quot;websecure&amp;quot;
      scheme = &amp;quot;https&amp;quot;
  
  [entryPoints.websecure]
    address = &amp;quot;:443&amp;quot;
    [entryPoints.websecure.http.tls]
      certResolver = &amp;quot;letsencrypt&amp;quot;
    [entryPoints.websecure.http.middlewares]
      middlewares = [&amp;quot;securityHeaders@file&amp;quot;]

[providers]
  [providers.docker]
    endpoint = &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault = false
    network = &amp;quot;proxy&amp;quot;
  
  [providers.file]
    filename = &amp;quot;/etc/traefik/dynamic.toml&amp;quot;

[certificatesResolvers]
  [certificatesResolvers.letsencrypt]
    [certificatesResolvers.letsencrypt.acme]
      email = &amp;quot;your-email@example.com&amp;quot;  # Replace with your email
      storage = &amp;quot;/letsencrypt/acme.json&amp;quot;
      [certificatesResolvers.letsencrypt.acme.tlsChallenge]

[api]
  dashboard = true

[log]
  level = &amp;quot;INFO&amp;quot;
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create dynamic configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/traefik/config/dynamic.toml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
[http.middlewares]
  [http.middlewares.securityHeaders.headers]
    browserXssFilter = true
    contentTypeNosniff = true
    frameDeny = true
    sslRedirect = true
    [http.middlewares.securityHeaders.headers.customResponseHeaders]
      X-Robots-Tag = &amp;quot;noindex,nofollow,nosnippet,noarchive,notranslate,noimageindex&amp;quot;
      Server = &amp;quot;&amp;quot;
    [http.middlewares.securityHeaders.headers.referrerPolicy]
      policy = &amp;quot;strict-origin-when-cross-origin&amp;quot;
    [http.middlewares.securityHeaders.headers.contentSecurityPolicy]
      policy = &amp;quot;default-src &amp;#39;self&amp;#39;; script-src &amp;#39;self&amp;#39; &amp;#39;unsafe-inline&amp;#39;; style-src &amp;#39;self&amp;#39; &amp;#39;unsafe-inline&amp;#39;; img-src &amp;#39;self&amp;#39; data: blob:; font-src &amp;#39;self&amp;#39; data:; media-src &amp;#39;self&amp;#39; blob:; connect-src &amp;#39;self&amp;#39; wss:; frame-src &amp;#39;self&amp;#39;; base-uri &amp;#39;self&amp;#39;; form-action &amp;#39;self&amp;#39;&amp;quot;

[http.routers]
  [http.routers.dashboard]
    rule = &amp;quot;Host(`traefik.your-domain.com`)&amp;quot;
    service = &amp;quot;api@internal&amp;quot;
    entryPoints = [&amp;quot;websecure&amp;quot;]
    middlewares = [&amp;quot;securityHeaders&amp;quot;, &amp;quot;traefik-auth&amp;quot;]
    [http.routers.dashboard.tls]
      certResolver = &amp;quot;letsencrypt&amp;quot;

[http.middlewares.traefik-auth.basicAuth]
  # Generate with: echo $(htpasswd -nb username password) | sed -e s/\\$/\\$\\$/g
  users = [&amp;quot;admin:$apr1$randomhash&amp;quot;]  # Replace with your own credentials
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Replace &lt;code&gt;your-email@example.com&lt;/code&gt;, &lt;code&gt;traefik.your-domain.com&lt;/code&gt;, and the basic auth credentials with your own.&lt;/p&gt;&lt;h3 id=&quot;step-3-create-docker-compose-for-traefik&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Compose for Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-docker-compose-for-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/traefik/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  traefik:
    image: traefik:latest
    container_name: traefik
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.toml:/etc/traefik/traefik.toml:ro
      - ./config/dynamic.toml:/etc/traefik/dynamic.toml:ro
      - ./letsencrypt:/letsencrypt
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;

networks:
  proxy:
    external: true
    name: proxy
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-create-docker-network&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Docker Network&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-create-docker-network&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker network create proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates the network that both Traefik and Jellyfin will use.&lt;/p&gt;&lt;h3 id=&quot;step-5-start-traefik&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-start-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/traefik &amp;amp;&amp;amp; docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts Traefik in the background.&lt;/p&gt;&lt;h3 id=&quot;step-6-start-jellyfin&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Jellyfin&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-start-jellyfin&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/jellyfin &amp;amp;&amp;amp; docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts Jellyfin in the background.&lt;/p&gt;&lt;h2 id=&quot;setting-up-fail2ban-for-additional-security-optional&quot;&gt;Setting Up Fail2ban for Additional Security (Optional)&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-fail2ban-for-additional-security-optional&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Fail2ban can protect against brute force attacks by temporarily banning IP addresses that show malicious behavior.&lt;/p&gt;&lt;h3 id=&quot;step-1-install-fail2ban&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Fail2ban&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-fail2ban&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt install fail2ban -y
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-configure-fail2ban-for-traefik&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Fail2ban for Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-configure-fail2ban-for-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo tee /etc/fail2ban/filter.d/traefik-auth.conf &amp;gt; /dev/null &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
[Definition]
failregex = ^.*\s&amp;quot;(GET|POST|HEAD).*401\s.*remote_ip=&amp;lt;HOST&amp;gt;\s.*$
ignoreregex =
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-create-jail-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Jail Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-jail-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo tee /etc/fail2ban/jail.d/traefik.conf &amp;gt; /dev/null &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
[traefik-auth]
enabled = true
port = http,https
filter = traefik-auth
logpath = /var/log/traefik/access.log
maxretry = 3
bantime = 3600
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-restart-fail2ban&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Restart Fail2ban&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-restart-fail2ban&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart fail2ban
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;backup-and-restore-procedures&quot;&gt;Backup and Restore Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-and-restore-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular backups are essential for data safety. Here&amp;#39;s how to set up automated backups for Jellyfin.&lt;/p&gt;&lt;h3 id=&quot;backup-script&quot;&gt;Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/backup-jellyfin.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
# Jellyfin backup script

# Set backup directory
BACKUP_DIR=&amp;quot;/path/to/backups/jellyfin&amp;quot;
mkdir -p &amp;quot;$BACKUP_DIR&amp;quot;

# Set date format for backup files
DATE=$(date +&amp;quot;%Y-%m-%d&amp;quot;)

# Backup Jellyfin configuration
tar -czf &amp;quot;$BACKUP_DIR/jellyfin-config-$DATE.tar.gz&amp;quot; -C ~/docker_data jellyfin/config

# Keep only the last 5 backups
ls -t &amp;quot;$BACKUP_DIR&amp;quot;/*.tar.gz | tail -n +6 | xargs rm -f

echo &amp;quot;Backup completed: $BACKUP_DIR/jellyfin-config-$DATE.tar.gz&amp;quot;
EOF

chmod +x ~/backup-jellyfin.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;set-up-automated-weekly-backups&quot;&gt;Set Up Automated Weekly Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-automated-weekly-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * 0 ~/backup-jellyfin.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This schedules the backup script to run every Sunday at 2 AM.&lt;/p&gt;&lt;h3 id=&quot;restore-procedure&quot;&gt;Restore Procedure&lt;a class=&quot;h-anchor&quot; href=&quot;#restore-procedure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you need to restore from a backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop containers
cd ~/docker_data/jellyfin &amp;amp;&amp;amp; docker-compose down

# Restore from backup
tar -xzf /path/to/backups/jellyfin/jellyfin-config-YYYY-MM-DD.tar.gz -C ~/docker_data/jellyfin

# Start containers
cd ~/docker_data/jellyfin &amp;amp;&amp;amp; docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Here are some common issues you might encounter and their solutions.&lt;/p&gt;&lt;h3 id=&quot;transcoding-issues&quot;&gt;Transcoding Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#transcoding-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Video transcoding is slow or failing.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs jellyfin | grep -i transcode
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Enable hardware acceleration if available.&lt;/p&gt;&lt;p&gt;For Intel GPUs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Install required packages on host
sudo apt install intel-media-va-driver-non-free -y

# Update docker-compose.yml
# Uncomment the devices section for /dev/dri
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart Jellyfin:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/jellyfin &amp;amp;&amp;amp; docker-compose down &amp;amp;&amp;amp; docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;connection-problems&quot;&gt;Connection Problems&lt;a class=&quot;h-anchor&quot; href=&quot;#connection-problems&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Cannot access Jellyfin through domain.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check if Traefik is running
docker ps | grep traefik

# Check Traefik logs
docker logs traefik
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Verify DNS resolution
nslookup jellyfin.your-domain.com

# Check if ports are forwarded correctly
curl -I http://your-domain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;docker-container-fails-to-start&quot;&gt;Docker Container Fails to Start&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-container-fails-to-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Jellyfin container won&amp;#39;t start.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs jellyfin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check permissions
sudo chown -R $(id -u):$(id -g) ~/docker_data/jellyfin

# Verify ports are not in use
sudo netstat -tuln | grep 8096
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular maintenance ensures your Jellyfin server remains secure and performs optimally.&lt;/p&gt;&lt;h3 id=&quot;updating-jellyfin&quot;&gt;Updating Jellyfin&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-jellyfin&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/jellyfin
docker-compose pull
docker-compose down
docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls the latest image, stops the current container, and starts a new one with the updated image.&lt;/p&gt;&lt;h3 id=&quot;updating-traefik&quot;&gt;Updating Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/traefik
docker-compose pull
docker-compose down
docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;system-updates&quot;&gt;System Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#system-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Periodic system updates are essential for security.&lt;/p&gt;&lt;h3 id=&quot;monitoring-disk-space&quot;&gt;Monitoring Disk Space&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-disk-space&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;df -h
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Regularly check disk space to ensure sufficient storage for media and container operations.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully functional, secure Jellyfin media server running on Ubuntu 20.04 using Docker. The configuration provides:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Isolated container environment for enhanced security&lt;/li&gt;&lt;li&gt;Automatic SSL certificate management with Let&amp;#39;s Encrypt&lt;/li&gt;&lt;li&gt;Reverse proxy with Traefik for secure internet access&lt;/li&gt;&lt;li&gt;Hardened TLS configuration to protect against common vulnerabilities&lt;/li&gt;&lt;li&gt;Backup and restore procedures to prevent data loss&lt;/li&gt;&lt;li&gt;Maintenance instructions for keeping the system updated and secure&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;By following this guide, you&amp;#39;ve implemented industry best practices for securing a self-hosted media server while maintaining convenient access for authorized users. Remember to regularly update all components and monitor for security advisories related to Docker, Ubuntu, Traefik, and Jellyfin to maintain the security of your system.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide to Self-Hosting n8n on Ubuntu 20.04+ with Docker</title><link>https://diylabhub.com/comprehensive-guide-to-self-hosting-n8n-on-ubuntu-20-04-with-docker/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-self-hosting-n8n-on-ubuntu-20-04-with-docker/</guid><pubDate>Sun, 09 Mar 2025 19:21:59 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;n8n is a powerful, free, and open-source workflow automation tool that connects various services and applications. Docker provides an optimal deployment method by creating a consistent environment for running n8n, effectively isolating the application from the host system. This isolation ensures compatibility across different operating systems and simplifies migration when changing hosts or environments.&lt;/p&gt;&lt;p&gt;This guide will walk you through every step of installing and configuring n8n using Docker on Ubuntu 20.04 or newer, addressing common issues and providing best practices for security and maintenance.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;instruction layout/chart&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/n8n_blog_post_Instruction_Layout-flowchart-942x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning the installation process, ensure your system meets these requirements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 or newer operating system&lt;/li&gt;&lt;li&gt;Minimum 1GB RAM (2GB+ recommended for production environments)&lt;/li&gt;&lt;li&gt;At least 10GB of available storage space&lt;/li&gt;&lt;li&gt;Dual-core processor (more cores beneficial for complex workflows)&lt;/li&gt;&lt;li&gt;Static IP address or domain name pointing to your server&lt;/li&gt;&lt;li&gt;Root or sudo access to execute administrative commands&lt;/li&gt;&lt;li&gt;Port 5678 available (n8n&amp;#39;s default port)&lt;/li&gt;&lt;li&gt;Basic knowledge of Linux commands, Docker concepts, and networking principles&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If running n8n behind a firewall or router, ensure port 5678 is properly forwarded to your server. For custom domain setup with SSL, configure DNS records to point to your server&amp;#39;s IP address.&lt;/p&gt;&lt;h2 id=&quot;docker-installation-on-ubuntu-2004&quot;&gt;Docker Installation on Ubuntu 20.04+&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-installation-on-ubuntu-2004&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-update-package-index&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Package Index&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-package-index&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates the package lists and upgrades existing packages to their latest versions.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-docker-dependencies&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages allow apt to use repositories over HTTPS and are prerequisites for secure Docker installation.&lt;/p&gt;&lt;h3 id=&quot;step-3-add-dockers-official-gpg-key&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Docker&amp;#39;s Official GPG Key&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-add-dockers-official-gpg-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds Docker&amp;#39;s GPG key to verify package authenticity during installation.&lt;/p&gt;&lt;h3 id=&quot;step-4-set-up-the-docker-repository&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up the Docker Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-set-up-the-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo add-apt-repository &amp;quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds the appropriate Docker repository for your Ubuntu version.&lt;/p&gt;&lt;h3 id=&quot;step-5-install-docker-engine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Updates the package database with Docker packages from the newly added repository.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker-ce docker-ce-cli containerd.io
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs Docker Engine, CLI, and containerd, the core components needed to run Docker containers.&lt;/p&gt;&lt;h3 id=&quot;step-6-verify-docker-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Docker Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-verify-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads a test image and runs it in a container. If Docker is properly installed, you&amp;#39;ll see a confirmation message.&lt;/p&gt;&lt;h3 id=&quot;step-7-enable-non-root-user-access-to-docker-optional&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enable Non-root User Access to Docker (Optional)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-enable-non-root-user-access-to-docker-optional&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Adds your user to the Docker group, allowing Docker commands without sudo.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Applies the new group membership without logging out.&lt;/p&gt;&lt;h2 id=&quot;installing-n8n-with-docker&quot;&gt;Installing n8n with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-n8n-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;single-container-setup-with-docker&quot;&gt;Single Container Setup with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#single-container-setup-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This is the simplest way to get started with n8n using Docker, using SQLite as the default database.&lt;/p&gt;&lt;h4 id=&quot;step-1-create-a-docker-volume-for-data-persistence&quot;&gt;Step 1: Create a Docker Volume for Data Persistence&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-docker-volume-for-data-persistence&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker volume create n8n_data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a Docker volume that will store all n8n data, including workflows, credentials, and execution history.&lt;/p&gt;&lt;h4 id=&quot;step-2-run-n8n-container&quot;&gt;Step 2: Run n8n Container&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-run-n8n-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -d --restart unless-stopped \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  n8nio/n8n
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Runs n8n in detached mode (&lt;code&gt;-d&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Configures automatic restart (&lt;code&gt;--restart unless-stopped&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Names the container for easy reference (&lt;code&gt;--name n8n&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Maps port 5678 on the host to port 5678 in the container&lt;/li&gt;&lt;li&gt;Mounts the Docker volume to n8n&amp;#39;s data directory&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;docker-compose-setup&quot;&gt;Docker Compose Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-compose-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker Compose allows you to define and run multi-container Docker applications, useful when running n8n alongside other services like a database.&lt;/p&gt;&lt;h4 id=&quot;step-1-create-directory-structure&quot;&gt;Step 1: Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/n8n/data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates directories for storing Docker Compose files and n8n data.&lt;/p&gt;&lt;h4 id=&quot;step-2-create-docker-compose-configuration&quot;&gt;Step 2: Create Docker Compose Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-docker-compose-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Create a docker-compose.yml file with SQLite (default database):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/n8n/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  n8n:
    image: n8nio/n8n
    restart: unless-stopped
    ports:
      - &amp;quot;5678:5678&amp;quot;
    volumes:
      - ./data:/home/node/.n8n
    environment:
      - N8N_ENCRYPTION_KEY=your-random-encryption-key
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - N8N_PORT=5678
      - NODE_ENV=production
    networks:
      - n8n-network

networks:
  n8n-network:
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a basic Docker Compose configuration for n8n with SQLite as the database.&lt;/p&gt;&lt;h4 id=&quot;step-3-start-n8n-with-docker-compose&quot;&gt;Step 3: Start n8n with Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-start-n8n-with-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/n8n
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands navigate to the directory containing the docker-compose.yml file and start n8n in detached mode.&lt;/p&gt;&lt;h3 id=&quot;advanced-setup-with-postgresql-database&quot;&gt;Advanced Setup with PostgreSQL Database&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-setup-with-postgresql-database&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For production environments, using PostgreSQL is recommended for better performance and reliability.&lt;/p&gt;&lt;h4 id=&quot;step-1-create-a-more-advanced-docker-compose-configuration&quot;&gt;Step 1: Create a More Advanced Docker Compose Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-more-advanced-docker-compose-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/n8n/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  n8n:
    image: n8nio/n8n
    restart: unless-stopped
    ports:
      - &amp;quot;5678:5678&amp;quot;
    volumes:
      - ./data:/home/node/.n8n
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_USER=n8n
      - DB_POSTGRESDB_PASSWORD=n8n_password
      - N8N_ENCRYPTION_KEY=your-random-encryption-key
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - N8N_PORT=5678
      - NODE_ENV=production
    networks:
      - n8n-network
    depends_on:
      - postgres

  postgres:
    image: postgres:13
    restart: unless-stopped
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=n8n
      - POSTGRES_USER=n8n
      - POSTGRES_PASSWORD=n8n_password
    networks:
      - n8n-network

volumes:
  postgres_data:

networks:
  n8n-network:
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This configuration sets up n8n with PostgreSQL as the database, creating a more robust and scalable solution.&lt;/p&gt;&lt;h4 id=&quot;step-2-start-n8n-with-postgresql&quot;&gt;Step 2: Start n8n with PostgreSQL&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-start-n8n-with-postgresql&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/n8n
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands start both n8n and PostgreSQL containers.&lt;/p&gt;&lt;h2 id=&quot;securing-n8n-with-ssltls&quot;&gt;Securing n8n with SSL/TLS&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-n8n-with-ssltls&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;method-1-using-nginx-as-a-reverse-proxy-with-lets-encrypt&quot;&gt;Method 1: Using Nginx as a Reverse Proxy with Let&amp;#39;s Encrypt&lt;a class=&quot;h-anchor&quot; href=&quot;#method-1-using-nginx-as-a-reverse-proxy-with-lets-encrypt&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;step-1-install-nginx-and-certbot&quot;&gt;Step 1: Install Nginx and Certbot&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-nginx-and-certbot&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs Nginx web server and Certbot for obtaining Let&amp;#39;s Encrypt SSL certificates.&lt;/p&gt;&lt;h4 id=&quot;step-2-obtain-ssl-certificate&quot;&gt;Step 2: Obtain SSL Certificate&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-obtain-ssl-certificate&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo certbot --nginx -d n8n.yourdomain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Obtains and installs an SSL certificate for your domain. Follow the prompts to complete the certificate issuance.&lt;/p&gt;&lt;h4 id=&quot;step-3-configure-nginx-as-a-reverse-proxy&quot;&gt;Step 3: Configure Nginx as a Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-configure-nginx-as-a-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo cat &amp;gt; /etc/nginx/sites-available/n8n &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
server {
    server_name n8n.yourdomain.com;

    location / {
        proxy_pass http://localhost:5678;
        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;
        
        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
        proxy_read_timeout 86400;
    }

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/n8n.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/n8n.yourdomain.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = n8n.yourdomain.com) {
        return 301 https://$host$request_uri;
    }
    listen 80;
    server_name n8n.yourdomain.com;
    return 404;
}
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates an Nginx configuration that acts as a reverse proxy for n8n and includes WebSocket support.&lt;/p&gt;&lt;h4 id=&quot;step-4-enable-the-configuration-and-restart-nginx&quot;&gt;Step 4: Enable the Configuration and Restart Nginx&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-enable-the-configuration-and-restart-nginx&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands enable the Nginx configuration, test it for syntax errors, and restart Nginx to apply the changes.&lt;/p&gt;&lt;h3 id=&quot;method-2-n8n-with-traefik-integration&quot;&gt;Method 2: n8n with Traefik Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#method-2-n8n-with-traefik-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Traefik is a modern HTTP reverse proxy and load balancer that can automatically manage SSL certificates.&lt;/p&gt;&lt;h4 id=&quot;step-1-create-docker-network-for-traefik&quot;&gt;Step 1: Create Docker Network for Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-docker-network-for-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker network create proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a Docker network for communication between Traefik and n8n.&lt;/p&gt;&lt;h4 id=&quot;step-2-create-directory-structure&quot;&gt;Step 2: Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/traefik/data
mkdir -p ~/docker_data/traefik/config
mkdir -p ~/docker_data/n8n/data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates directories for Traefik and n8n data and configuration files.&lt;/p&gt;&lt;h4 id=&quot;step-3-create-traefik-configuration&quot;&gt;Step 3: Create Traefik Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-traefik-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/traefik/config/traefik.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
api:
  dashboard: true
  debug: true

entryPoints:
  http:
    address: &amp;quot;:80&amp;quot;
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
  https:
    address: &amp;quot;:443&amp;quot;

providers:
  docker:
    endpoint: &amp;quot;unix:///var/run/docker.sock&amp;quot;
    exposedByDefault: false
    network: proxy

certificatesResolvers:
  letsencrypt:
    acme:
      email: your-email@example.com
      storage: /data/acme.json
      httpChallenge:
        entryPoint: http
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a Traefik configuration file with support for automatic SSL certificate generation.&lt;/p&gt;&lt;h4 id=&quot;step-4-create-traefik-docker-compose-file&quot;&gt;Step 4: Create Traefik Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-create-traefik-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/traefik/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  traefik:
    image: traefik:v2.5
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - &amp;quot;80:80&amp;quot;
      - &amp;quot;443:443&amp;quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik.yml:/traefik.yml:ro
      - ./data:/data
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.rule=Host(`traefik.yourdomain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.tls.certresolver=letsencrypt&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.service=api@internal&amp;quot;
      - &amp;quot;traefik.http.routers.traefik.middlewares=auth&amp;quot;
      - &amp;quot;traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$xyz123$$aBcDeFgHiJkLmNoPqRsTuV/&amp;quot; # Change this

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a Docker Compose file for Traefik with automatic SSL certificate management.&lt;/p&gt;&lt;h4 id=&quot;step-5-create-n8n-docker-compose-file-for-traefik&quot;&gt;Step 5: Create n8n Docker Compose File for Traefik&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-create-n8n-docker-compose-file-for-traefik&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/n8n/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  n8n:
    image: n8nio/n8n
    restart: unless-stopped
    volumes:
      - ./data:/home/node/.n8n
    environment:
      - N8N_ENCRYPTION_KEY=your-random-encryption-key
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - N8N_PORT=443
      - NODE_ENV=production
    networks:
      - proxy
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.n8n.entrypoints=https&amp;quot;
      - &amp;quot;traefik.http.routers.n8n.rule=Host(`n8n.yourdomain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.n8n.tls.certresolver=letsencrypt&amp;quot;
      - &amp;quot;traefik.http.services.n8n.loadbalancer.server.port=5678&amp;quot;

networks:
  proxy:
    external: true
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a Docker Compose file for n8n that integrates with Traefik for automatic SSL certificate management.&lt;/p&gt;&lt;h4 id=&quot;step-6-start-traefik-and-n8n&quot;&gt;Step 6: Start Traefik and n8n&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-start-traefik-and-n8n&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/traefik
docker compose up -d

cd ~/docker_data/n8n
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands start both Traefik and n8n containers.&lt;/p&gt;&lt;h2 id=&quot;advanced-security-configuration&quot;&gt;Advanced Security Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-security-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;securing-n8n-with-authentication&quot;&gt;Securing n8n with Authentication&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-n8n-with-authentication&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Enable basic authentication to protect your n8n instance:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/n8n/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  n8n:
    image: n8nio/n8n
    restart: unless-stopped
    ports:
      - &amp;quot;5678:5678&amp;quot;
    volumes:
      - ./data:/home/node/.n8n
    environment:
      - N8N_ENCRYPTION_KEY=your-random-encryption-key
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - N8N_PORT=5678
      - NODE_ENV=production
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=secure_password
    networks:
      - n8n-network

networks:
  n8n-network:
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This configuration enables basic authentication for n8n, requiring a username and password to access the interface.&lt;/p&gt;&lt;h3 id=&quot;implementing-ip-restrictions&quot;&gt;Implementing IP Restrictions&lt;a class=&quot;h-anchor&quot; href=&quot;#implementing-ip-restrictions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To restrict access to n8n from specific IP addresses, update your Nginx configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo cat &amp;gt; /etc/nginx/sites-available/n8n &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
server {
    server_name n8n.yourdomain.com;

    # IP restrictions
    allow 192.168.1.0/24;  # Allow your local network
    allow 203.0.113.0/24;  # Allow your office network
    deny all;             # Deny all other IPs

    location / {
        proxy_pass http://localhost:5678;
        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;
        
        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
        proxy_read_timeout 86400;
    }

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/n8n.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/n8n.yourdomain.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This configuration restricts access to n8n to specific IP ranges.&lt;/p&gt;&lt;h3 id=&quot;setting-resource-limits&quot;&gt;Setting Resource Limits&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-resource-limits&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To prevent resource exhaustion, set Docker resource limits:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/docker_data/n8n/docker-compose.yml &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
version: &amp;#39;3&amp;#39;

services:
  n8n:
    image: n8nio/n8n
    restart: unless-stopped
    ports:
      - &amp;quot;5678:5678&amp;quot;
    volumes:
      - ./data:/home/node/.n8n
    environment:
      - N8N_ENCRYPTION_KEY=your-random-encryption-key
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - N8N_PORT=5678
      - NODE_ENV=production
    deploy:
      resources:
        limits:
          cpus: &amp;#39;1&amp;#39;
          memory: 1G
        reservations:
          cpus: &amp;#39;0.5&amp;#39;
          memory: 512M
    networks:
      - n8n-network

networks:
  n8n-network:
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This configuration limits the CPU and memory usage of the n8n container.&lt;/p&gt;&lt;h2 id=&quot;data-persistence-and-backup&quot;&gt;Data Persistence and Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence-and-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;creating-a-backup-script&quot;&gt;Creating a Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-a-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/backup-n8n.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash

TIMESTAMP=$(date +&amp;quot;%Y%m%d%H%M%S&amp;quot;)
BACKUP_DIR=~/backups
BACKUP_FILE=&amp;quot;$BACKUP_DIR/n8n_backup_$TIMESTAMP.tar.gz&amp;quot;

# Create backup directory if it doesn&amp;#39;t exist
mkdir -p $BACKUP_DIR

# Backup n8n data
tar -czvf $BACKUP_FILE -C ~/docker_data/n8n data

# Keep only the last 7 backups
ls -t $BACKUP_DIR/n8n_backup_*.tar.gz | tail -n +8 | xargs -r rm

echo &amp;quot;Backup completed: $BACKUP_FILE&amp;quot;
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x ~/backup-n8n.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This script creates a compressed backup of n8n data and retains the most recent 7 backups.&lt;/p&gt;&lt;h3 id=&quot;scheduling-automated-backups&quot;&gt;Scheduling Automated Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#scheduling-automated-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * /home/$USER/backup-n8n.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command adds a cron job that runs the backup script every day at 2:00 AM.&lt;/p&gt;&lt;h3 id=&quot;restore-procedures&quot;&gt;Restore Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#restore-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To restore n8n data from a backup, use this restore script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/restore-n8n.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash

if [ -z &amp;quot;$1&amp;quot; ]; then
  echo &amp;quot;Usage: $0 &amp;lt;backup_file&amp;gt;&amp;quot;
  exit 1
fi

BACKUP_FILE=&amp;quot;$1&amp;quot;

if [ ! -f &amp;quot;$BACKUP_FILE&amp;quot; ]; then
  echo &amp;quot;Backup file not found: $BACKUP_FILE&amp;quot;
  exit 1
fi

# Stop n8n container
docker stop n8n

# Create a backup of the current data (just in case)
TIMESTAMP=$(date +&amp;quot;%Y%m%d%H%M%S&amp;quot;)
CURRENT_BACKUP=&amp;quot;~/n8n_current_data_$TIMESTAMP.tar.gz&amp;quot;
tar -czvf $CURRENT_BACKUP -C ~/docker_data/n8n data
echo &amp;quot;Current data backed up to: $CURRENT_BACKUP&amp;quot;

# Remove current data
rm -rf ~/docker_data/n8n/data

# Restore from backup
mkdir -p ~/docker_data/n8n
tar -xzvf $BACKUP_FILE -C ~/docker_data/n8n

# Start n8n container
docker start n8n

echo &amp;quot;Restore completed&amp;quot;
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x ~/restore-n8n.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To restore from a backup, run:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;~/restore-n8n.sh /path/to/backup/file.tar.gz
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;/path/to/backup/file.tar.gz&lt;/code&gt; with the actual path to your backup file.&lt;/p&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;container-startup-issues&quot;&gt;Container Startup Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#container-startup-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the n8n container fails to start, check the logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs n8n
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Common issues include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Incorrect environment variables&lt;/li&gt;&lt;li&gt;Port conflicts&lt;/li&gt;&lt;li&gt;Insufficient disk space&lt;/li&gt;&lt;li&gt;Permission problems&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If there&amp;#39;s a port conflict, verify which process is using port 5678:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo lsof -i :5678
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To check if n8n is running and listening on the expected port:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps -a
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows all containers, including stopped ones. If n8n is running, verify it&amp;#39;s bound to 0.0.0.0:5678.&lt;/p&gt;&lt;h3 id=&quot;ssl-certificate-issues&quot;&gt;SSL Certificate Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#ssl-certificate-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you encounter SSL certificate errors, check:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Certificate file existence and permissions: &lt;code&gt;ls -la /etc/letsencrypt/live/n8n.yourdomain.com/&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Certificate renewal capability: &lt;code&gt;sudo certbot renew --dry-run&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Nginx configuration correctness: &lt;code&gt;sudo nginx -t&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;database-connection-issues&quot;&gt;Database Connection Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#database-connection-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For PostgreSQL connection problems:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Check if PostgreSQL container is running: &lt;code&gt;docker ps | grep postgres&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check PostgreSQL logs: &lt;code&gt;docker logs postgres&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Verify environment variables: &lt;code&gt;docker exec n8n env | grep DB_&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;websocket-connection-failures&quot;&gt;WebSocket Connection Failures&lt;a class=&quot;h-anchor&quot; href=&quot;#websocket-connection-failures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Ensure your Nginx configuration includes WebSocket support:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo cat &amp;gt; /etc/nginx/sites-available/n8n &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
server {
    server_name n8n.yourdomain.com;

    location / {
        proxy_pass http://localhost:5678;
        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;
        
        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
        proxy_read_timeout 86400;
    }

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/n8n.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/n8n.yourdomain.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
EOF
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Reload Nginx:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl reload nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;update-n8n&quot;&gt;Update n8n&lt;a class=&quot;h-anchor&quot; href=&quot;#update-n8n&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update n8n to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker pull n8nio/n8n:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;With Docker Compose:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/n8n
docker compose pull
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitor-logs&quot;&gt;Monitor Logs&lt;a class=&quot;h-anchor&quot; href=&quot;#monitor-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Watch n8n logs for issues:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs -f n8n
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;update-ssl-certificates&quot;&gt;Update SSL Certificates&lt;a class=&quot;h-anchor&quot; href=&quot;#update-ssl-certificates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check Certbot&amp;#39;s auto-renewal status:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status certbot.timer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Manually trigger certificate renewal:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo certbot renew
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;update-system-packages&quot;&gt;Update System Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#update-system-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Keep your system updated:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Self-hosting n8n on Ubuntu 20.04+ with Docker provides a flexible and powerful workflow automation solution that you have complete control over. The Docker deployment method offers advantages in terms of isolation, consistency, and ease of migration, making it the preferred option for most self-hosting scenarios.&lt;/p&gt;&lt;p&gt;Regular maintenance is essential for keeping your n8n instance secure and up-to-date. Remember to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Update both n8n and your underlying system regularly&lt;/li&gt;&lt;li&gt;Monitor logs for any issues&lt;/li&gt;&lt;li&gt;Maintain proper backups to protect your workflows and data&lt;/li&gt;&lt;li&gt;Review security settings periodically&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;With these practices in place, your self-hosted n8n instance will provide a reliable platform for automating workflows and connecting various services.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide to Installing and Securing Nginx Proxy Manager on Ubuntu 20.04+</title><link>https://diylabhub.com/comprehensive-guide-to-installing-and-securing-nginx-proxy-manager-on-ubuntu-20-04/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-installing-and-securing-nginx-proxy-manager-on-ubuntu-20-04/</guid><pubDate>Sun, 09 Mar 2025 16:25:24 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Nginx Proxy Manager offers a streamlined approach to managing your reverse proxy configurations through an intuitive web interface. This powerful tool simplifies the creation of proxy hosts, SSL certificate management, and access control rules without requiring deep knowledge of Nginx configuration syntax. In this guide, we&amp;#39;ll walk through the complete process of installing, configuring, and securing Nginx Proxy Manager on Ubuntu 20.04 or newer using Docker.&lt;/p&gt;&lt;h2 id=&quot;introduction-to-nginx-proxy-manager&quot;&gt;Introduction to Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-to-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Nginx Proxy Manager provides a user-friendly web interface for managing Nginx, one of the most powerful and widely used web servers and reverse proxies. It eliminates the need to manually edit complex configuration files by offering an intuitive dashboard where you can:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Set up proxy hosts&lt;/li&gt;&lt;li&gt;Manage SSL certificates&lt;/li&gt;&lt;li&gt;Configure redirections&lt;/li&gt;&lt;li&gt;Implement access controls&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Using Docker for deployment offers several advantages, including isolation from the host system, simplified updates, and easy integration with other containerized applications.&lt;/p&gt;&lt;p&gt;The key benefits of using Nginx Proxy Manager include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Automatic SSL certificate management through Let&amp;#39;s Encrypt&lt;/li&gt;&lt;li&gt;Ability to easily manage multiple domains and services through a single interface&lt;/li&gt;&lt;li&gt;Detailed access control options&lt;/li&gt;&lt;li&gt;Streamlined proxy configuration process&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;All of this is available without sacrificing the robust performance and reliability that Nginx is known for.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Instruction layout/chart&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/NginxProxyManager-Blog-Instruction-Layout-flowchart-865x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites-for-installation&quot;&gt;Prerequisites for Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites-for-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before proceeding with the installation, ensure that your system meets these requirements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 or newer server with at least 1GB of RAM and 10GB of available storage space&lt;/li&gt;&lt;li&gt;Root or sudo access for installing system packages and configuring permissions&lt;/li&gt;&lt;li&gt;Open ports:&lt;ul&gt;&lt;li&gt;80 (HTTP)&lt;/li&gt;&lt;li&gt;443 (HTTPS)&lt;/li&gt;&lt;li&gt;81 (admin interface)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;A domain name (highly recommended for securing the admin interface and for Let&amp;#39;s Encrypt SSL certificates)&lt;/li&gt;&lt;li&gt;Basic familiarity with Linux command-line operations, networking concepts, and Docker fundamentals&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;With these prerequisites in place, you&amp;#39;re ready to proceed with the installation.&lt;/p&gt;&lt;h2 id=&quot;installing-docker-and-docker-compose&quot;&gt;Installing Docker and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-docker-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker provides the containerization platform that will host our Nginx Proxy Manager installation. Let&amp;#39;s start by setting up Docker and Docker Compose on your Ubuntu server.&lt;/p&gt;&lt;h3 id=&quot;update-system-packages&quot;&gt;Update System Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#update-system-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Begin by ensuring your system packages are up to date:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command updates your package lists and upgrades all installed packages to their latest versions.&lt;/p&gt;&lt;h3 id=&quot;install-docker-prerequisites&quot;&gt;Install Docker Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Next, install the necessary packages that allow apt to use repositories over HTTPS:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages provide the infrastructure needed to securely download and verify Docker installation files.&lt;/p&gt;&lt;h3 id=&quot;add-docker-repository-and-install-docker&quot;&gt;Add Docker Repository and Install Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#add-docker-repository-and-install-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now we&amp;#39;ll add Docker&amp;#39;s official GPG key and set up the Docker repository:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Add Docker&amp;#39;s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# Set up the stable repository
echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null

# Update apt package index
sudo apt update

# Install Docker Engine
sudo apt install docker-ce docker-ce-cli containerd.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands add the Docker repository to your system, update the package index, and install the Docker engine.&lt;/p&gt;&lt;h3 id=&quot;enable-and-start-docker-service&quot;&gt;Enable and Start Docker Service&lt;a class=&quot;h-anchor&quot; href=&quot;#enable-and-start-docker-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To ensure Docker starts automatically when your system boots:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl start docker
sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The first command starts Docker immediately, while the second ensures it automatically starts whenever your system boots up.&lt;/p&gt;&lt;h3 id=&quot;verify-docker-installation&quot;&gt;Verify Docker Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#verify-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Confirm that Docker was installed correctly by running a test container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If successful, you&amp;#39;ll see a message indicating that your Docker installation is working correctly.&lt;/p&gt;&lt;h3 id=&quot;install-docker-compose&quot;&gt;Install Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker Compose allows us to define and run multi-container Docker applications:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo curl -L &amp;quot;https://github.com/docker/compose/releases/download/v2.18.1/docker-compose-$(uname -s)-$(uname -m)&amp;quot; -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The first command downloads the Docker Compose binary, and the second makes it executable.&lt;/p&gt;&lt;h2 id=&quot;setting-up-nginx-proxy-manager-with-docker&quot;&gt;Setting Up Nginx Proxy Manager with Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-nginx-proxy-manager-with-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Docker and Docker Compose are installed, we can proceed with setting up Nginx Proxy Manager.&lt;/p&gt;&lt;h3 id=&quot;create-directory-structure&quot;&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, create the directory structure for storing Nginx Proxy Manager&amp;#39;s data and SSL certificates:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/nginx-proxy-manager/data ~/docker_data/nginx-proxy-manager/letsencrypt
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command creates two directories: one for the application data (including the database) and another for storing SSL certificates.&lt;/p&gt;&lt;h3 id=&quot;create-a-custom-docker-network&quot;&gt;Create a Custom Docker Network&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-custom-docker-network&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Creating a custom Docker network improves security by isolating containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker network create proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This network will be used for communication between Nginx Proxy Manager and other services you may want to proxy.&lt;/p&gt;&lt;h3 id=&quot;create-docker-compose-configuration&quot;&gt;Create Docker Compose Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#create-docker-compose-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Navigate to the Nginx Proxy Manager directory and create a docker-compose.yml file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/nginx-proxy-manager
nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Copy and paste the following configuration into the file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3&amp;#39;
services:
  app:
    image: &amp;#39;jc21/nginx-proxy-manager:latest&amp;#39;
    container_name: nginx-proxy-manager
    restart: unless-stopped
    ports:
      - &amp;#39;80:80&amp;#39;
      - &amp;#39;81:81&amp;#39;
      - &amp;#39;443:443&amp;#39;
    environment:
      DB_SQLITE_FILE: &amp;quot;/data/database.sqlite&amp;quot;
      PUID: 1000
      PGID: 1000
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    networks:
      - proxy

networks:
  proxy:
    external: true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit the file (press Ctrl+X, then Y, then Enter).&lt;/p&gt;&lt;h3 id=&quot;start-nginx-proxy-manager&quot;&gt;Start Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#start-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Launch the Nginx Proxy Manager container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The &lt;code&gt;-d&lt;/code&gt; flag runs the container in detached mode, allowing it to run in the background. Docker will pull the necessary image and start the container.&lt;/p&gt;&lt;h3 id=&quot;verify-the-container-is-running&quot;&gt;Verify the Container is Running&lt;a class=&quot;h-anchor&quot; href=&quot;#verify-the-container-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check that the container started successfully:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the nginx-proxy-manager container in the list of running containers.&lt;/p&gt;&lt;h2 id=&quot;initial-configuration&quot;&gt;Initial Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#initial-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Nginx Proxy Manager is running, let&amp;#39;s set up the initial configuration.&lt;/p&gt;&lt;h3 id=&quot;access-the-web-interface&quot;&gt;Access the Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#access-the-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your web browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://your_server_ip:81
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your_server_ip&lt;/code&gt; with the actual IP address of your server. You should see the Nginx Proxy Manager login page.&lt;/p&gt;&lt;h3 id=&quot;default-login-credentials&quot;&gt;Default Login Credentials&lt;a class=&quot;h-anchor&quot; href=&quot;#default-login-credentials&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For the first-time login, use these default credentials:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Email: &lt;code&gt;admin@example.com&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Password: &lt;code&gt;changeme&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You&amp;#39;ll be prompted to change these credentials immediately after login.&lt;/p&gt;&lt;h3 id=&quot;change-default-credentials&quot;&gt;Change Default Credentials&lt;a class=&quot;h-anchor&quot; href=&quot;#change-default-credentials&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Enter your own email address and a strong password. These will be your new admin credentials for logging into Nginx Proxy Manager.&lt;/p&gt;&lt;h2 id=&quot;security-best-practices&quot;&gt;Security Best Practices&lt;a class=&quot;h-anchor&quot; href=&quot;#security-best-practices&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;#39;s implement some security best practices to protect your Nginx Proxy Manager installation.&lt;/p&gt;&lt;h3 id=&quot;securing-the-admin-interface&quot;&gt;Securing the Admin Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-the-admin-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;It&amp;#39;s recommended to secure the admin interface (port 81) by creating a proxy host with SSL:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;First, create a proxy host for a subdomain (e.g., &lt;code&gt;npm.yourdomain.com&lt;/code&gt;) that points to your server&amp;#39;s IP address&lt;/li&gt;&lt;li&gt;In Nginx Proxy Manager, go to &amp;quot;Proxy Hosts&amp;quot; → &amp;quot;Add Proxy Host&amp;quot;&lt;/li&gt;&lt;li&gt;Enter the following details:&lt;ul&gt;&lt;li&gt;Domain Names: &lt;code&gt;npm.yourdomain.com&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Scheme: &lt;code&gt;http&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Forward Hostname/IP: &lt;code&gt;nginx-proxy-manager&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Forward Port: &lt;code&gt;81&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Enable &amp;quot;Block Common Exploits&amp;quot;&lt;/li&gt;&lt;li&gt;Enable SSL with Let&amp;#39;s Encrypt&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This allows you to access the admin interface securely via &lt;code&gt;https://npm.yourdomain.com&lt;/code&gt; rather than using the IP address and port 81.&lt;/p&gt;&lt;h3 id=&quot;configure-a-firewall&quot;&gt;Configure a Firewall&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-a-firewall&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up a basic firewall with UFW to restrict access to your server:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Install UFW if not already installed
sudo apt install ufw -y

# Allow SSH to prevent being locked out
sudo ufw allow ssh

# Allow Nginx Proxy Manager required ports
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 81

# Enable the firewall
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify the firewall status:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see that ports 22 (SSH), 80, 81, and 443 are allowed.&lt;/p&gt;&lt;h2 id=&quot;setting-up-backup-procedures&quot;&gt;Setting Up Backup Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-backup-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular backups are essential for any production system. Let&amp;#39;s set up an automated backup process for Nginx Proxy Manager.&lt;/p&gt;&lt;h3 id=&quot;create-a-backup-script&quot;&gt;Create a Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a simple backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/backup-npm.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Copy and paste the following script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
TIMESTAMP=$(date +&amp;quot;%Y%m%d-%H%M%S&amp;quot;)
BACKUP_DIR=~/backups/nginx-proxy-manager

# Create backup directory if it doesn&amp;#39;t exist
mkdir -p $BACKUP_DIR

# Create a compressed archive of the data
cd ~/docker_data
tar -czf $BACKUP_DIR/npm-backup-$TIMESTAMP.tar.gz nginx-proxy-manager/

# Delete backups older than 7 days
find $BACKUP_DIR -type f -name &amp;quot;npm-backup-*.tar.gz&amp;quot; -mtime +7 -delete
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x ~/backup-npm.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;schedule-automatic-backups&quot;&gt;Schedule Automatic Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#schedule-automatic-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up a daily backup using cron:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 0 * * * ~/backup-npm.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This schedules the backup script to run every day at midnight.&lt;/p&gt;&lt;h3 id=&quot;restoring-from-backups&quot;&gt;Restoring from Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#restoring-from-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you need to restore from a backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop the Nginx Proxy Manager container
cd ~/docker_data/nginx-proxy-manager
docker compose down

# Remove the current data (be careful with this command!)
rm -rf data letsencrypt

# Extract the backup
tar -xzf ~/backups/nginx-proxy-manager/npm-backup-TIMESTAMP.tar.gz -C ~/docker_data/

# Start the container again
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace TIMESTAMP with the actual timestamp of the backup you want to restore.&lt;/p&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Even with careful installation and configuration, you may encounter issues with Nginx Proxy Manager. Here are some common problems and their solutions.&lt;/p&gt;&lt;h3 id=&quot;container-fails-to-start&quot;&gt;Container Fails to Start&lt;a class=&quot;h-anchor&quot; href=&quot;#container-fails-to-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the Nginx Proxy Manager container fails to start, check the logs for error messages:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs nginx-proxy-manager
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Common causes and solutions:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Port conflicts&lt;/strong&gt;: If ports 80, 81, or 443 are already in use, the container won&amp;#39;t start. Check for other services using these ports: &lt;code&gt;sudo lsof -i :80,81,443&lt;/code&gt; Stop or reconfigure any services using these ports.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Permission issues&lt;/strong&gt;: If the container can&amp;#39;t write to the mounted volumes, it may fail. Check permissions on the data directories: &lt;code&gt;ls -la ~/docker_data/nginx-proxy-manager/&lt;/code&gt; Ensure the directories are owned by the user specified in the PUID/PGID environment variables.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;ssl-certificate-issues&quot;&gt;SSL Certificate Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#ssl-certificate-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you&amp;#39;re having trouble obtaining or renewing SSL certificates:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;DNS configuration&lt;/strong&gt;: Ensure your domain correctly points to your server&amp;#39;s IP address: &lt;code&gt;dig +short yourdomain.com&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Firewall rules&lt;/strong&gt;: Let&amp;#39;s Encrypt needs to reach your server on ports 80 and 443 to verify domain ownership. Ensure these ports are open.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Rate limiting&lt;/strong&gt;: Let&amp;#39;s Encrypt has rate limits for certificate issuance. If you&amp;#39;ve requested too many certificates recently, you might need to wait before requesting more.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;502-bad-gateway-errors&quot;&gt;502 Bad Gateway Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#502-bad-gateway-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you&amp;#39;re seeing 502 Bad Gateway errors when accessing proxied services:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Service availability&lt;/strong&gt;: Ensure the proxied service is running and accessible: &lt;code&gt;curl -I http://service-hostname:port&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Network connectivity&lt;/strong&gt;: If using Docker networks, ensure both containers are on the same network.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Timeout settings&lt;/strong&gt;: For services that take longer to respond, increase the proxy timeout settings in the custom Nginx configuration: &lt;code&gt;proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;&lt;/code&gt; Add these settings in the &amp;quot;Advanced&amp;quot; tab of your proxy host configuration.&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;advanced-configuration-options&quot;&gt;Advanced Configuration Options&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-configuration-options&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For users who need more advanced features, here are some additional configuration options.&lt;/p&gt;&lt;h3 id=&quot;using-mysqlmariadb-instead-of-sqlite&quot;&gt;Using MySQL/MariaDB Instead of SQLite&lt;a class=&quot;h-anchor&quot; href=&quot;#using-mysqlmariadb-instead-of-sqlite&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For larger deployments, using MySQL or MariaDB instead of SQLite can provide better performance:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;
services:
  app:
    image: &amp;#39;jc21/nginx-proxy-manager:latest&amp;#39;
    # ... other settings ...
    environment:
      DB_MYSQL_HOST: &amp;quot;db&amp;quot;
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: &amp;quot;npm&amp;quot;
      DB_MYSQL_PASSWORD: &amp;quot;secure_password&amp;quot;
      DB_MYSQL_NAME: &amp;quot;npm&amp;quot;
      PUID: 1000
      PGID: 1000
    # ... volumes and networks ...
    depends_on:
      - db

  db:
    image: &amp;#39;jc21/mariadb-aria:latest&amp;#39;
    container_name: npm-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: &amp;quot;secure_root_password&amp;quot;
      MYSQL_DATABASE: &amp;quot;npm&amp;quot;
      MYSQL_USER: &amp;quot;npm&amp;quot;
      MYSQL_PASSWORD: &amp;quot;secure_password&amp;quot;
    volumes:
      - ~/docker_data/nginx-proxy-manager/mysql:/var/lib/mysql
    networks:
      - proxy
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;quot;secure_password&amp;quot; and &amp;quot;secure_root_password&amp;quot; with strong, unique passwords.&lt;/p&gt;&lt;h3 id=&quot;custom-nginx-configurations&quot;&gt;Custom Nginx Configurations&lt;a class=&quot;h-anchor&quot; href=&quot;#custom-nginx-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Nginx Proxy Manager allows you to add custom Nginx configurations to each proxy host:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Custom headers&lt;/strong&gt;: &lt;code&gt;add_header X-Frame-Options &amp;quot;SAMEORIGIN&amp;quot;; add_header X-Content-Type-Options &amp;quot;nosniff&amp;quot;; add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;URL rewrites&lt;/strong&gt;: &lt;code&gt;rewrite ^/old-path$ /new-path permanent;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Advanced authentication&lt;/strong&gt;: Implement HTTP basic authentication or more complex authentication schemes.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;These custom configurations can be added in the &amp;quot;Advanced&amp;quot; tab when editing a proxy host.&lt;/p&gt;&lt;h2 id=&quot;maintenance-and-updates&quot;&gt;Maintenance and Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-and-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular maintenance and updates are essential for keeping your Nginx Proxy Manager installation secure and functioning correctly.&lt;/p&gt;&lt;h3 id=&quot;updating-nginx-proxy-manager&quot;&gt;Updating Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update Nginx Proxy Manager to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/docker_data/nginx-proxy-manager
docker compose pull
docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This process pulls the latest image, stops the current container, and starts a new container with the updated image.&lt;/p&gt;&lt;h3 id=&quot;monitoring-container-health&quot;&gt;Monitoring Container Health&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-container-health&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Regularly monitor the health of your Nginx Proxy Manager container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check container status
docker ps -a | grep nginx-proxy-manager

# View recent logs
docker logs --tail 100 nginx-proxy-manager

# Monitor resource usage
docker stats nginx-proxy-manager
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands allow you to verify that the container is running correctly and check for any error messages.&lt;/p&gt;&lt;h3 id=&quot;certificate-renewals&quot;&gt;Certificate Renewals&lt;a class=&quot;h-anchor&quot; href=&quot;#certificate-renewals&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Let&amp;#39;s Encrypt certificates are valid for 90 days, and Nginx Proxy Manager automatically attempts to renew them when they&amp;#39;re 30 days from expiration. Monitor certificate renewals:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker exec -it nginx-proxy-manager certbot certificates
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command lists all certificates managed by Let&amp;#39;s Encrypt, along with their expiration dates.&lt;/p&gt;&lt;h3 id=&quot;system-updates&quot;&gt;System Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#system-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Regularly update your Ubuntu server to ensure you have the latest security patches:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After significant system updates, especially kernel updates, you might need to reboot your server.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In this comprehensive guide, we&amp;#39;ve covered the complete process of installing, configuring, and securing Nginx Proxy Manager on Ubuntu 20.04 or newer using Docker. By following these steps, you&amp;#39;ve established a robust reverse proxy solution that provides an intuitive web interface for managing your proxy configurations and SSL certificates.&lt;/p&gt;&lt;p&gt;We&amp;#39;ve explored security best practices, including the use of custom Docker networks, firewall configuration, access controls, and regular backups. These measures help protect your proxy manager and the services it handles from unauthorized access and potential data loss.&lt;/p&gt;&lt;p&gt;Nginx Proxy Manager simplifies what would otherwise be a complex task, making it accessible to users with varying levels of technical expertise. Whether you&amp;#39;re managing a single website or dozens of services, this tool provides a streamlined approach to proxy management without sacrificing the power and flexibility of Nginx.&lt;/p&gt;&lt;p&gt;Remember to regularly update both Nginx Proxy Manager and your underlying system, monitor for security issues, and maintain good backup practices. With proper care, your Nginx Proxy Manager installation will serve as a reliable gateway to your services for years to come.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>A Complete Guide to Installing and Securing Portainer on Ubuntu 20.04 and Up</title><link>https://diylabhub.com/a-complete-guide-to-installing-and-securing-portainer-on-ubuntu-20-04-and-up/</link><guid isPermaLink="true">https://diylabhub.com/a-complete-guide-to-installing-and-securing-portainer-on-ubuntu-20-04-and-up/</guid><pubDate>Sun, 09 Mar 2025 15:35:40 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Portainer is a powerful, lightweight container management platform that provides an intuitive web-based interface for managing Docker environments. Originally designed solely for Docker, Portainer has evolved to support multiple container environments including Docker Swarm, Kubernetes, and Azure Container Instances. It significantly reduces the learning curve for Docker management by eliminating the need to memorize complex command-line instructions.&lt;/p&gt;&lt;p&gt;Portainer is available in two editions:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Community Edition (CE)&lt;/strong&gt;: Free and open-source, designed primarily for individual use and home labs&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Business Edition (BE)&lt;/strong&gt;: Offers extended features like advanced role-based access control and registry management for enterprise environments&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This guide focuses on the Community Edition, which provides robust features suitable for most users while requiring minimal system resources.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Instruction layout/chart&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Portainer-Instruction_Layout2-886x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Portainer is remarkably lightweight:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;CPU: 1 core (minimum)&lt;/li&gt;&lt;li&gt;RAM: 1 GB (minimum)&lt;/li&gt;&lt;li&gt;Storage: 10 GB available space for Docker and Portainer&lt;/li&gt;&lt;li&gt;Network connectivity: Internet access for pulling Docker images&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To successfully install and run Portainer, you&amp;#39;ll need:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer (this guide is tested on Ubuntu 20.04 and 22.04)&lt;/li&gt;&lt;li&gt;Current system packages (we&amp;#39;ll update these during installation)&lt;/li&gt;&lt;li&gt;Terminal access with sudo privileges&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Portainer requires specific ports to be accessible:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Port 9443: For secure HTTPS access to the Portainer web interface (default)&lt;/li&gt;&lt;li&gt;Port 8000: For the Edge agent communication (only if using Edge compute features)&lt;/li&gt;&lt;li&gt;Port 9000: For HTTP access (optional, mainly for legacy compatibility)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;user-permissions&quot;&gt;User Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#user-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You&amp;#39;ll need a user account with sudo privileges for installation. Following security best practices, we&amp;#39;ll avoid using the root account directly.&lt;/p&gt;&lt;h2 id=&quot;step-1-update-your-system&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Your System&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-your-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning any installation, ensure your system is up-to-date with the latest security patches and package versions.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command updates your package lists and upgrades all installed packages to their latest versions. If prompted for a restart after updating, reboot before continuing.&lt;/p&gt;&lt;h2 id=&quot;step-2-install-docker-engine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Portainer requires Docker Engine to function. If you already have Docker installed, verify it with &lt;code&gt;docker --version&lt;/code&gt; and skip to Step 3.&lt;/p&gt;&lt;h3 id=&quot;remove-any-conflicting-packages&quot;&gt;Remove any conflicting packages&lt;a class=&quot;h-anchor&quot; href=&quot;#remove-any-conflicting-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get remove docker docker-engine docker.io containerd runc -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures a clean slate by removing any older or conflicting versions.&lt;/p&gt;&lt;h3 id=&quot;install-required-dependencies&quot;&gt;Install required dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#install-required-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages allow apt to use repositories over HTTPS, work with certificates, and fetch Docker&amp;#39;s official GPG keys.&lt;/p&gt;&lt;h3 id=&quot;add-dockers-official-gpg-key&quot;&gt;Add Docker&amp;#39;s official GPG key&lt;a class=&quot;h-anchor&quot; href=&quot;#add-dockers-official-gpg-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads Docker&amp;#39;s GPG key and stores it for package verification, ensuring the packages you install are authentic.&lt;/p&gt;&lt;h3 id=&quot;set-up-the-docker-repository&quot;&gt;Set up the Docker repository&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-the-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds the official Docker repository to your system&amp;#39;s sources list, automatically detecting your system architecture and Ubuntu version.&lt;/p&gt;&lt;h3 id=&quot;update-package-lists-with-the-new-repository&quot;&gt;Update package lists with the new repository&lt;a class=&quot;h-anchor&quot; href=&quot;#update-package-lists-with-the-new-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This refreshes your package lists with the newly added Docker repository.&lt;/p&gt;&lt;h3 id=&quot;install-docker-engine&quot;&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install docker-ce docker-ce-cli containerd.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the Docker Engine, CLI, and containerd runtime.&lt;/p&gt;&lt;h3 id=&quot;start-and-enable-docker-service&quot;&gt;Start and enable Docker service&lt;a class=&quot;h-anchor&quot; href=&quot;#start-and-enable-docker-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl start docker
sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands start the Docker service and configure it to start automatically when the system boots.&lt;/p&gt;&lt;h3 id=&quot;verify-docker-installation&quot;&gt;Verify Docker installation&lt;a class=&quot;h-anchor&quot; href=&quot;#verify-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This checks that Docker is running properly. You should see output indicating that the service is active (running).&lt;/p&gt;&lt;h3 id=&quot;add-your-user-to-the-docker-group&quot;&gt;Add your user to the Docker group&lt;a class=&quot;h-anchor&quot; href=&quot;#add-your-user-to-the-docker-group&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds your current user to the Docker group, allowing you to run Docker commands without using sudo. This change will take effect after you log out and log back in, or apply it immediately with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;test-docker-functionality&quot;&gt;Test Docker functionality&lt;a class=&quot;h-anchor&quot; href=&quot;#test-docker-functionality&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls and runs the hello-world image. If successful, you&amp;#39;ll see a message indicating that Docker is properly installed and your user has the appropriate permissions.&lt;/p&gt;&lt;h2 id=&quot;step-3-install-portainer&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Portainer&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-install-portainer&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Docker is installed and running, we can proceed with installing Portainer. We&amp;#39;ll present multiple methods, allowing you to choose the one that best fits your needs.&lt;/p&gt;&lt;h3 id=&quot;method-1-standard-docker-installation&quot;&gt;Method 1: Standard Docker Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#method-1-standard-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This is the simplest method, using basic Docker commands.&lt;/p&gt;&lt;h4 id=&quot;create-a-persistent-volume-for-portainer-data&quot;&gt;Create a persistent volume for Portainer data&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-persistent-volume-for-portainer-data&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker volume create portainer_data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a named volume that will store Portainer&amp;#39;s data, ensuring it persists even if the container is removed or updated.&lt;/p&gt;&lt;h4 id=&quot;run-portainer-container&quot;&gt;Run Portainer container&lt;a class=&quot;h-anchor&quot; href=&quot;#run-portainer-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command runs the Portainer container with the following configuration:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;-d&lt;/code&gt;: Runs the container in detached mode (in the background)&lt;/li&gt;&lt;li&gt;&lt;code&gt;-p 8000:8000 -p 9443:9443&lt;/code&gt;: Maps container ports to host ports for web UI and Edge agent communication&lt;/li&gt;&lt;li&gt;&lt;code&gt;--name=portainer&lt;/code&gt;: Names the container &amp;quot;portainer&amp;quot; for easy reference&lt;/li&gt;&lt;li&gt;&lt;code&gt;--restart=always&lt;/code&gt;: Ensures the container automatically restarts if it stops or if Docker restarts&lt;/li&gt;&lt;li&gt;&lt;code&gt;-v /var/run/docker.sock:/var/run/docker.sock&lt;/code&gt;: Mounts the Docker socket to give Portainer access to the Docker API&lt;/li&gt;&lt;li&gt;&lt;code&gt;-v portainer_data:/data&lt;/code&gt;: Mounts the previously created volume to store Portainer data&lt;/li&gt;&lt;li&gt;&lt;code&gt;portainer/portainer-ce:latest&lt;/code&gt;: Specifies the image to use (latest Portainer Community Edition)&lt;/li&gt;&lt;/ul&gt;&lt;h4 id=&quot;verify-portainer-is-running&quot;&gt;Verify Portainer is running&lt;a class=&quot;h-anchor&quot; href=&quot;#verify-portainer-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the Portainer container listed with its status as &amp;quot;Up&amp;quot;.&lt;/p&gt;&lt;h3 id=&quot;method-2-docker-compose-installation&quot;&gt;Method 2: Docker Compose Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#method-2-docker-compose-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker Compose provides a more declarative way to deploy containers, making it easier to understand and maintain your configuration.&lt;/p&gt;&lt;h4 id=&quot;install-docker-compose-plugin-if-not-already-installed&quot;&gt;Install Docker Compose plugin (if not already installed)&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-compose-plugin-if-not-already-installed&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install docker-compose-plugin -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the Docker Compose plugin, which provides the &lt;code&gt;docker compose&lt;/code&gt; command.&lt;/p&gt;&lt;h4 id=&quot;create-a-directory-for-portainer&quot;&gt;Create a directory for Portainer&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-directory-for-portainer&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/docker_data/portainer
cd ~/docker_data/portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory structure for our Portainer deployment.&lt;/p&gt;&lt;h4 id=&quot;create-docker-composeyml-file&quot;&gt;Create docker-compose.yml file&lt;a class=&quot;h-anchor&quot; href=&quot;#create-docker-composeyml-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Create a docker-compose.yml file with proper configuration. Note: The exact content of this file was not fully provided in the original document.&lt;/p&gt;&lt;h2 id=&quot;step-4-access-and-initial-setup&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access and Initial Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-access-and-initial-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After installing Portainer, you need to access it and complete the initial setup.&lt;/p&gt;&lt;h3 id=&quot;access-the-portainer-web-interface&quot;&gt;Access the Portainer Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#access-the-portainer-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your web browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;https://YOUR_SERVER_IP:9443
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;YOUR_SERVER_IP&lt;/code&gt; with your server&amp;#39;s IP address. You may see a security warning because Portainer uses a self-signed certificate by default. This is expected - you can proceed safely for initial setup.&lt;/p&gt;&lt;h3 id=&quot;create-the-admin-user&quot;&gt;Create the Admin User&lt;a class=&quot;h-anchor&quot; href=&quot;#create-the-admin-user&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On first access, you&amp;#39;ll be prompted to create an admin user:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Enter a username (commonly &amp;quot;admin&amp;quot;)&lt;/li&gt;&lt;li&gt;Create a strong password (at least 12 characters with a mix of uppercase, lowercase, numbers, and special characters)&lt;/li&gt;&lt;li&gt;Click &amp;quot;Create User&amp;quot;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;connect-to-the-local-docker-environment&quot;&gt;Connect to the Local Docker Environment&lt;a class=&quot;h-anchor&quot; href=&quot;#connect-to-the-local-docker-environment&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;After creating the admin user, you&amp;#39;ll be prompted to connect to a Docker environment:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Choose &amp;quot;Docker&amp;quot; as the environment type&lt;/li&gt;&lt;li&gt;Select &amp;quot;Connect to local Docker environment&amp;quot; since we&amp;#39;re managing the Docker installation on the same machine&lt;/li&gt;&lt;li&gt;Click &amp;quot;Connect&amp;quot;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;You&amp;#39;re now ready to use Portainer to manage your Docker environment!&lt;/p&gt;&lt;h2 id=&quot;step-5-enhancing-security&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enhancing Security&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-enhancing-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Security is crucial for any container management system. Here are essential steps to secure your Portainer installation:&lt;/p&gt;&lt;h3 id=&quot;enable-https-with-a-proper-ssl-certificate&quot;&gt;Enable HTTPS with a Proper SSL Certificate&lt;a class=&quot;h-anchor&quot; href=&quot;#enable-https-with-a-proper-ssl-certificate&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For production environments, replace the self-signed certificate with a proper SSL certificate:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stop portainer
docker rm portainer
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data -v /path/to/certs:/certs portainer/portainer-ce:latest --ssl --sslcert /certs/portainer.crt --sslkey /certs/portainer.key
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;/path/to/certs&lt;/code&gt; with the actual path to your certificate files.&lt;/p&gt;&lt;h3 id=&quot;configure-firewall-rules&quot;&gt;Configure Firewall Rules&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-firewall-rules&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Restrict access to Portainer&amp;#39;s ports using UFW (Uncomplicated Firewall):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow 22/tcp
sudo ufw allow 9443/tcp
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows SSH (port 22) and Portainer&amp;#39;s web interface (port 9443) while blocking other incoming connections.&lt;/p&gt;&lt;h3 id=&quot;implement-user-management&quot;&gt;Implement User Management&lt;a class=&quot;h-anchor&quot; href=&quot;#implement-user-management&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Once logged into Portainer:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Go to &amp;quot;Settings&amp;quot; &amp;gt; &amp;quot;Users&amp;quot; to create additional users with appropriate permissions&lt;/li&gt;&lt;li&gt;Create teams and assign users to them for more granular access control&lt;/li&gt;&lt;li&gt;Use Role-Based Access Control (RBAC) to limit what different users can do&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This follows the principle of least privilege, ensuring users only have access to the resources they need.&lt;/p&gt;&lt;h2 id=&quot;step-6-data-persistence-and-backup&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Data Persistence and Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-data-persistence-and-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Proper data management ensures you can recover from failures and maintain continuity of your Portainer installation.&lt;/p&gt;&lt;h3 id=&quot;creating-a-backup-of-portainer-data&quot;&gt;Creating a Backup of Portainer Data&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-a-backup-of-portainer-data&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To create a backup of your Portainer data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm -v portainer_data:/data -v $(pwd):/backup alpine sh -c &amp;quot;cd /data &amp;amp;&amp;amp; tar -czf /backup/portainer-backup-$(date +%Y%m%d%H%M%S).tar.gz .&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command creates a timestamped backup archive of your Portainer data in the current directory.&lt;/p&gt;&lt;h3 id=&quot;scheduling-regular-backups&quot;&gt;Scheduling Regular Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#scheduling-regular-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For automated backups, create a simple bash script and schedule it with cron:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cat &amp;gt; ~/backup-portainer.sh &amp;lt;&amp;lt; &amp;#39;EOF&amp;#39;
#!/bin/bash
BACKUP_DIR=~/portainer-backups
mkdir -p $BACKUP_DIR
docker run --rm -v portainer_data:/data -v $BACKUP_DIR:/backup alpine sh -c &amp;quot;cd /data &amp;amp;&amp;amp; tar -czf /backup/portainer-backup-$(date +%Y%m%d%H%M%S).tar.gz .&amp;quot;
find $BACKUP_DIR -type f -name &amp;quot;portainer-backup-*.tar.gz&amp;quot; -mtime +7 -delete
EOF

chmod +x ~/backup-portainer.sh
(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * * ~/backup-portainer.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up a daily backup at 2:00 AM and retains only the seven most recent backups.&lt;/p&gt;&lt;h3 id=&quot;restoring-from-backup&quot;&gt;Restoring from Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#restoring-from-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To restore Portainer from a backup:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Stop the Portainer container:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stop portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;Remove the existing volume (caution: this will delete all current Portainer data):&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker volume rm portainer_data
docker volume create portainer_data
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;3&quot;&gt;&lt;li&gt;Restore data from your backup:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm -v portainer_data:/data -v /path/to/backup/directory:/backup alpine sh -c &amp;quot;cd /data &amp;amp;&amp;amp; tar -xzf /backup/your-backup-file.tar.gz&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;/path/to/backup/directory&lt;/code&gt; and &lt;code&gt;your-backup-file.tar.gz&lt;/code&gt; with the actual backup directory and file name.&lt;/p&gt;&lt;ol start=&quot;4&quot;&gt;&lt;li&gt;Restart Portainer:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker start portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;step-7-common-problems-and-troubleshooting&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Common Problems and Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-common-problems-and-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Even with careful installation, issues can arise. Here are solutions to common problems:&lt;/p&gt;&lt;h3 id=&quot;connection-refused-errors&quot;&gt;Connection Refused Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#connection-refused-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Unable to connect to Portainer web interface.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -kI https://localhost:9443
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Verify Portainer is running: &lt;code&gt;docker ps | grep portainer&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check if the correct ports are being exposed: &lt;code&gt;docker port portainer&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Ensure your firewall allows connections to port 9443: &lt;code&gt;sudo ufw status&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If using a different port, make sure you&amp;#39;re accessing the correct one&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;certificate-issues&quot;&gt;Certificate Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#certificate-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: SSL certificate errors when accessing Portainer.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;For development/testing: Add a security exception in your browser&lt;/li&gt;&lt;li&gt;For production: Use a proper SSL certificate as described in the security section&lt;/li&gt;&lt;li&gt;If using a custom certificate, verify it&amp;#39;s correctly formatted and not expired: &lt;code&gt;openssl x509 -in /path/to/your/certs/portainer.crt -text -noout&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;docker-socket-permission-issues&quot;&gt;Docker Socket Permission Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-socket-permission-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Portainer cannot connect to Docker daemon, often showing &amp;quot;Error 500&amp;quot; messages.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Look for messages related to permission denied on &lt;code&gt;/var/run/docker.sock&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ensure the Docker socket is properly mounted: &lt;code&gt;docker inspect portainer | grep docker.sock&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check Docker socket permissions: &lt;code&gt;ls -la /var/run/docker.sock&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If necessary, adjust permissions (use with caution as this has security implications): &lt;code&gt;sudo chmod 666 /var/run/docker.sock&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;port-conflicts&quot;&gt;Port Conflicts&lt;a class=&quot;h-anchor&quot; href=&quot;#port-conflicts&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Container fails to start due to port conflicts.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo netstat -tulpn | grep -E &amp;#39;9443|8000&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Identify the process using the conflicting port: &lt;code&gt;sudo lsof -i :9443&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Stop the conflicting service or use different ports for Portainer: &lt;code&gt;docker run -d -p 9444:9443 -p 8001:8000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;browser-cache-issues&quot;&gt;Browser Cache Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#browser-cache-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: UI appears broken or outdated after updates.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Clear your browser cache&lt;/li&gt;&lt;li&gt;Try accessing Portainer in a private/incognito window&lt;/li&gt;&lt;li&gt;Use a different browser&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;step-8-maintenance-procedures&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular maintenance ensures your Portainer installation remains secure and up-to-date.&lt;/p&gt;&lt;h3 id=&quot;updating-portainer&quot;&gt;Updating Portainer&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-portainer&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update Portainer to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For standard Docker installation
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:latest
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For Docker Compose installation
cd ~/docker_data/portainer
docker compose pull
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This process stops and removes the current container, pulls the latest image, and creates a new container with the same settings. Your data is preserved because it&amp;#39;s stored in the persistent volume.&lt;/p&gt;&lt;h3 id=&quot;monitoring-portainer&quot;&gt;Monitoring Portainer&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-portainer&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To monitor Portainer&amp;#39;s resource usage:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stats portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs -f portainer
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The &lt;code&gt;-f&lt;/code&gt; flag follows the log output in real-time. Press Ctrl+C to exit.&lt;/p&gt;&lt;h3 id=&quot;cleanup-and-optimization&quot;&gt;Cleanup and Optimization&lt;a class=&quot;h-anchor&quot; href=&quot;#cleanup-and-optimization&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Regularly clean up unused Docker resources to prevent disk space issues:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Remove unused containers: &lt;code&gt;docker container prune -f&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Remove unused images: &lt;code&gt;docker image prune -f&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Remove unused volumes (be careful, as this will delete data): &lt;code&gt;docker volume prune -f&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;security-auditing&quot;&gt;Security Auditing&lt;a class=&quot;h-anchor&quot; href=&quot;#security-auditing&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Periodically review your Portainer security configuration:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check for outdated versions with known vulnerabilities&lt;/li&gt;&lt;li&gt;Review user accounts and permissions&lt;/li&gt;&lt;li&gt;Verify SSL certificate validity&lt;/li&gt;&lt;li&gt;Check firewall rules&lt;/li&gt;&lt;li&gt;Examine access logs for suspicious activity&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You&amp;#39;ve now successfully installed, secured, and configured Portainer on your Ubuntu 20.04 or newer system. This powerful container management platform provides an intuitive interface for managing Docker environments, making it easier to deploy and maintain containerized applications. By following the security practices outlined in this guide, you&amp;#39;ve established a solid foundation for safe container management.&lt;/p&gt;&lt;p&gt;Regular maintenance tasks like backups, updates, and security audits will ensure your Portainer installation remains reliable and secure over time. As your containerized infrastructure grows, Portainer&amp;#39;s robust management capabilities will continue to simplify operations and enhance productivity.&lt;/p&gt;&lt;p&gt;Whether you&amp;#39;ve chosen a simple standalone installation or a more complex setup, you now have the knowledge to effectively manage and secure your Portainer environment. The comprehensive troubleshooting section should help you resolve any issues that might arise, ensuring smooth operation of your container management solution.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>The Complete Guide to Installing and Securing Uptime Kuma on Ubuntu 20.04 and Later</title><link>https://diylabhub.com/the-complete-guide-to-installing-and-securing-uptime-kuma-on-ubuntu-20-04-and-later/</link><guid isPermaLink="true">https://diylabhub.com/the-complete-guide-to-installing-and-securing-uptime-kuma-on-ubuntu-20-04-and-later/</guid><pubDate>Sun, 09 Mar 2025 09:38:23 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Uptime Kuma is a powerful, open-source, self-hosted monitoring tool that allows you to track the availability and performance of your websites, services, and applications. This comprehensive guide covers multiple deployment methods for Ubuntu 20.04 and newer, with a primary focus on Docker as the recommended approach for most users.&lt;/p&gt;&lt;h2 id=&quot;understanding-uptime-kuma&quot;&gt;Understanding Uptime Kuma&lt;a class=&quot;h-anchor&quot; href=&quot;#understanding-uptime-kuma&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Uptime Kuma provides a sleek, modern web interface for monitoring the uptime of your digital assets. Unlike proprietary solutions, Uptime Kuma gives you complete control over your monitoring data while offering features such as:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Status pages&lt;/li&gt;&lt;li&gt;Comprehensive notification options (including Telegram, Discord, Slack, email)&lt;/li&gt;&lt;li&gt;Detailed metrics about response times and availability&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The application is based on Node.js and uses WebSocket for real-time updates, ensuring you receive immediate notifications when a service goes down. It offers monitoring via multiple methods including HTTP/HTTPS, TCP, Ping, DNS, and more, making it versatile for different types of services. The interface is intuitive and responsive, making it accessible even to users with minimal technical experience.&lt;/p&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning the installation, ensure your system meets the following requirements:&lt;/p&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;CPU: At least 1 vCPU&lt;/li&gt;&lt;li&gt;RAM: Minimum 512 MB (1 GB or more recommended)&lt;/li&gt;&lt;li&gt;Storage: At least 10 GB of available disk space&lt;/li&gt;&lt;li&gt;A stable internet connection&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 or newer (instructions also work for Ubuntu 22.04 and later)&lt;/li&gt;&lt;li&gt;SSH access with sudo privileges&lt;/li&gt;&lt;li&gt;Basic familiarity with terminal commands&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Open port 3001 for initial access (can be changed later)&lt;/li&gt;&lt;li&gt;If using a reverse proxy (recommended): open ports 80 and 443&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;p&gt;Instruction Layout Graph:&lt;br/&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Untitled-diagram-2025-03-09-181846-429x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;installation-method-comparison&quot;&gt;Installation Method Comparison&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-method-comparison&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;There are multiple ways to install Uptime Kuma on Ubuntu, each with its own benefits:&lt;/p&gt;&lt;h3 id=&quot;docker-installation-recommended&quot;&gt;Docker Installation (Recommended)&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-installation-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker provides the simplest installation method with excellent isolation and easier updates. This is the recommended approach for most users as it requires minimal system configuration and offers the most straightforward upgrade path.&lt;/p&gt;&lt;h3 id=&quot;docker-compose-installation&quot;&gt;Docker Compose Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-compose-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Similar to Docker but offers better management for multi-container applications. Ideal if you&amp;#39;re already using Docker Compose for other services.&lt;/p&gt;&lt;h3 id=&quot;native-installation&quot;&gt;Native Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#native-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Installing directly on the host system. More resource-efficient but requires more system configuration and dependency management.&lt;/p&gt;&lt;p&gt;For most users, the Docker installation provides the best balance of simplicity, security, and maintainability. We&amp;#39;ll focus primarily on this method while also providing instructions for alternatives.&lt;/p&gt;&lt;h2 id=&quot;docker-installation-method&quot;&gt;Docker Installation Method&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-installation-method&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This section covers installing Uptime Kuma using Docker, which is the recommended method for most users.&lt;/p&gt;&lt;h3 id=&quot;step-1-update-system-packages&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update System Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-system-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, update your system packages to ensure you have the latest security updates and package information:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates your package lists and upgrades all installed packages to their latest versions.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-docker&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Docker is not already installed on your system, install it using the following commands:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs prerequisite packages needed for the Docker installation.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds Docker&amp;#39;s official GPG key. If you get a warning about apt-key being deprecated, you can ignore it for now.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo add-apt-repository &amp;quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds the Docker repository for your specific Ubuntu version.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates package information from the newly added repository.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install docker-ce docker-ce-cli containerd.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Docker Community Edition, the CLI, and containerd.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This verifies Docker is running properly. You should see &amp;quot;active (running)&amp;quot; in the output. Press Q to exit this view.&lt;/p&gt;&lt;h3 id=&quot;step-3-set-up-docker-for-non-root-use-optional-but-recommended&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up Docker for Non-Root Use (Optional but Recommended)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-set-up-docker-for-non-root-use-optional-but-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To avoid having to use sudo for every Docker command, add your user to the Docker group:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds your current user to the Docker group. You&amp;#39;ll need to log out and back in for this change to take effect.&lt;/p&gt;&lt;h3 id=&quot;step-4-create-a-docker-volume-for-uptime-kuma&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Docker Volume for Uptime Kuma&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-create-a-docker-volume-for-uptime-kuma&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a Docker volume to store Uptime Kuma&amp;#39;s data persistently:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker volume create uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a named volume that will persist even if the container is removed.&lt;/p&gt;&lt;h3 id=&quot;step-5-run-the-uptime-kuma-container&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Run the Uptime Kuma Container&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-run-the-uptime-kuma-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now, deploy the Uptime Kuma container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Runs the container in detached mode (&lt;code&gt;-d&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Sets it to always restart if it fails or after a system reboot (&lt;code&gt;--restart=always&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Maps port 3001 on your host to port 3001 in the container (&lt;code&gt;-p 3001:3001&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Mounts the volume we created to store data (&lt;code&gt;-v uptime-kuma:/app/data&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Names the container &amp;quot;uptime-kuma&amp;quot; for easy reference (&lt;code&gt;--name uptime-kuma&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Uses the &amp;quot;louislam/uptime-kuma:1&amp;quot; image, which is the stable version (&lt;code&gt;louislam/uptime-kuma:1&lt;/code&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;step-6-verify-the-container-is-running&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify the Container is Running&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-verify-the-container-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check if the container is running correctly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the uptime-kuma container in the list. If not, check for errors using:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows the container logs, which can help identify any startup issues.&lt;/p&gt;&lt;h3 id=&quot;step-7-access-the-uptime-kuma-web-interface&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access the Uptime Kuma Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-access-the-uptime-kuma-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open a web browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://YOUR_SERVER_IP:3001
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace YOUR_SERVER_IP with your server&amp;#39;s actual IP address.&lt;/p&gt;&lt;p&gt;You&amp;#39;ll be presented with the initial setup screen where you can:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Select your preferred language&lt;/li&gt;&lt;li&gt;Create an administrator username and password&lt;/li&gt;&lt;li&gt;Complete the setup&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;docker-compose-installation-method&quot;&gt;Docker Compose Installation Method&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-compose-installation-method&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you prefer using Docker Compose for container management, follow these steps instead of the Docker method above.&lt;/p&gt;&lt;h3 id=&quot;step-1-update-system-packages-1&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update System Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-system-packages-1&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures your system is up to date.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-docker-and-docker-compose&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-docker-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If not already installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo add-apt-repository &amp;quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-create-a-directory-for-uptime-kuma&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Directory for Uptime Kuma&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-a-directory-for-uptime-kuma&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/uptime-kuma
cd ~/uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory to store your Docker Compose configuration.&lt;/p&gt;&lt;h3 id=&quot;step-4-create-the-docker-compose-file&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create the Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-create-the-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a docker-compose.yml file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Paste the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;version: &amp;#39;3&amp;#39;
services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    restart: always
    ports:
      - &amp;quot;3001:3001&amp;quot;
    volumes:
      - uptime-kuma:/app/data
    security_opt:
      - no-new-privileges:true
volumes:
  uptime-kuma:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit by pressing Ctrl+X, then Y, then Enter.&lt;/p&gt;&lt;h3 id=&quot;step-5-start-uptime-kuma-with-docker-compose&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Uptime Kuma with Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-start-uptime-kuma-with-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts the container in detached mode. Note: in newer versions of Docker, the command is &lt;code&gt;docker compose&lt;/code&gt; (without a hyphen) rather than &lt;code&gt;docker-compose&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;step-6-verify-uptime-kuma-is-running&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Uptime Kuma is Running&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-verify-uptime-kuma-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-7-access-the-web-interface&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access the Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-access-the-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Access Uptime Kuma at http://YOUR_SERVER_IP:3001&lt;/p&gt;&lt;h2 id=&quot;securing-uptime-kuma-with-a-reverse-proxy&quot;&gt;Securing Uptime Kuma with a Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-uptime-kuma-with-a-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Running Uptime Kuma behind a reverse proxy with SSL encryption is highly recommended for production environments. This section covers setting up Caddy as a reverse proxy, which automatically handles SSL certificate provisioning.&lt;/p&gt;&lt;h3 id=&quot;step-1-install-caddy&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Caddy&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-caddy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -1sLf &amp;#39;https://dl.cloudsmith.io/public/caddy/stable/gpg.key&amp;#39; | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -1sLf &amp;#39;https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt&amp;#39; | sudo tee /etc/apt/sources.list.d/caddy-stable.list
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install caddy
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-configure-caddy&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Caddy&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-configure-caddy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Edit the Caddy configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/caddy/Caddyfile
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace the content with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;your-domain.com {
    reverse_proxy localhost:3001
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-domain.com&lt;/code&gt; with your actual domain name that points to your server.&lt;/p&gt;&lt;p&gt;Save and exit by pressing Ctrl+X, then Y, then Enter.&lt;/p&gt;&lt;h3 id=&quot;step-3-restart-caddy&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Restart Caddy&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-restart-caddy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart caddy
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-configure-firewall-if-enabled&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Firewall (if enabled)&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-configure-firewall-if-enabled&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you&amp;#39;re using UFW (Ubuntu&amp;#39;s default firewall):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows HTTP and HTTPS traffic.&lt;/p&gt;&lt;h3 id=&quot;step-5-access-uptime-kuma-securely&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access Uptime Kuma Securely&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-access-uptime-kuma-securely&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now you can access Uptime Kuma via HTTPS:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;https://your-domain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Caddy automatically provisions and renews SSL certificates from Let&amp;#39;s Encrypt.&lt;/p&gt;&lt;h2 id=&quot;configuration-and-usage&quot;&gt;Configuration and Usage&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-and-usage&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After successfully installing Uptime Kuma, you&amp;#39;ll need to configure it to monitor your services.&lt;/p&gt;&lt;h3 id=&quot;initial-setup&quot;&gt;Initial Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#initial-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Upon first access, select your preferred language&lt;/li&gt;&lt;li&gt;Create an administrator account with a strong password&lt;/li&gt;&lt;li&gt;Click &amp;quot;Create&amp;quot; to finalize the setup&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;adding-monitors&quot;&gt;Adding Monitors&lt;a class=&quot;h-anchor&quot; href=&quot;#adding-monitors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;From the dashboard, click &amp;quot;Add New Monitor&amp;quot;&lt;/li&gt;&lt;li&gt;Enter a name for your monitor&lt;/li&gt;&lt;li&gt;Select the type of monitoring (HTTP(s), Ping, TCP, etc.)&lt;/li&gt;&lt;li&gt;Enter the URL or IP address to monitor&lt;/li&gt;&lt;li&gt;Configure the check interval (how often to check)&lt;/li&gt;&lt;li&gt;Configure notification settings if desired&lt;/li&gt;&lt;li&gt;Click &amp;quot;Save&amp;quot; to create the monitor&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;setting-up-notifications&quot;&gt;Setting Up Notifications&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-notifications&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Uptime Kuma supports various notification methods:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Click &amp;quot;Settings&amp;quot; in the sidebar&lt;/li&gt;&lt;li&gt;Go to &amp;quot;Notification&amp;quot; tab&lt;/li&gt;&lt;li&gt;Click &amp;quot;Setup Notification&amp;quot;&lt;/li&gt;&lt;li&gt;Select your preferred notification method&lt;/li&gt;&lt;li&gt;Fill in the required information&lt;/li&gt;&lt;li&gt;Test the notification&lt;/li&gt;&lt;li&gt;Save the configuration&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;data-persistence-and-backups&quot;&gt;Data Persistence and Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence-and-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;understanding-docker-volume-persistence&quot;&gt;Understanding Docker Volume Persistence&lt;a class=&quot;h-anchor&quot; href=&quot;#understanding-docker-volume-persistence&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Docker installation uses a volume named &lt;code&gt;uptime-kuma&lt;/code&gt; to store data. This volume persists even if the container is removed, ensuring your configuration and monitoring history remain intact during updates or container recreation.&lt;/p&gt;&lt;h3 id=&quot;creating-backups&quot;&gt;Creating Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To back up your Uptime Kuma data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Find the volume&amp;#39;s mount point
docker volume inspect uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Look for the &amp;quot;Mountpoint&amp;quot; value in the output.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Create a backup (run as root or with sudo)
sudo tar -czvf uptime-kuma-backup-$(date +%Y%m%d).tar.gz -C /var/lib/docker/volumes/uptime-kuma/_data .
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a compressed backup of your data with the current date in the filename.&lt;/p&gt;&lt;h3 id=&quot;restoring-from-backup&quot;&gt;Restoring from Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#restoring-from-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To restore from a backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop the container
docker stop uptime-kuma

# Remove the container (data volume remains intact)
docker rm uptime-kuma

# Extract backup to the volume (run as root or with sudo)
sudo tar -xzvf uptime-kuma-backup-YYYYMMDD.tar.gz -C /var/lib/docker/volumes/uptime-kuma/_data

# Start a new container using the same volume
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace YYYYMMDD with the date of your backup file.&lt;/p&gt;&lt;h2 id=&quot;updating-uptime-kuma&quot;&gt;Updating Uptime Kuma&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-uptime-kuma&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-docker-installation&quot;&gt;Updating Docker Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-docker-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Pull the latest image
docker pull louislam/uptime-kuma:1

# Stop and remove the current container
docker stop uptime-kuma
docker rm uptime-kuma

# Create a new container with the updated image
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;updating-docker-compose-installation&quot;&gt;Updating Docker Compose Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-docker-compose-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Navigate to your compose directory
cd ~/uptime-kuma

# Pull the latest image
docker compose pull

# Restart the container with the new image
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;common-issues-and-troubleshooting&quot;&gt;Common Issues and Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;container-fails-to-start&quot;&gt;Container Fails to Start&lt;a class=&quot;h-anchor&quot; href=&quot;#container-fails-to-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the container doesn&amp;#39;t start:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Look for error messages in the output. Common issues include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Port conflicts: If port 3001 is already in use, change the port mapping in your docker run command, e.g., &lt;code&gt;-p 3002:3001&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Insufficient permissions: Ensure your user has the correct Docker permissions&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;cannot-access-web-interface&quot;&gt;Cannot Access Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#cannot-access-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you cannot access the web interface:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Verify the container is running: &lt;code&gt;docker ps | grep uptime-kuma&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check if the port is accessible: &lt;code&gt;curl -v localhost:3001&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Verify firewall settings: &lt;code&gt;sudo ufw status&lt;/code&gt; Ensure port 3001 is allowed (or 80/443 if using a reverse proxy)&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;notifications-not-working&quot;&gt;Notifications Not Working&lt;a class=&quot;h-anchor&quot; href=&quot;#notifications-not-working&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If notifications aren&amp;#39;t being sent:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Test notification settings from the Uptime Kuma interface&lt;/li&gt;&lt;li&gt;Check outbound connectivity from your server&lt;/li&gt;&lt;li&gt;Verify service-specific configuration (e.g., correct API keys, tokens)&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;monitor-shows-false-positives&quot;&gt;Monitor Shows False Positives&lt;a class=&quot;h-anchor&quot; href=&quot;#monitor-shows-false-positives&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If monitors are incorrectly reporting services as down:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check the monitor settings for appropriate timeouts&lt;/li&gt;&lt;li&gt;Verify connectivity between your Uptime Kuma server and the monitored service&lt;/li&gt;&lt;li&gt;Consider adding retry settings to monitors to reduce false positives&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;known-issues-and-workarounds&quot;&gt;Known Issues and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-issues-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;docker-alpine-version-issues&quot;&gt;Docker Alpine Version Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#docker-alpine-version-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Alpine-based Docker image has known DNS resolution issues. Use the Debian-based image instead by specifying &amp;quot;louislam/uptime-kuma:1&amp;quot; or &amp;quot;louislam/uptime-kuma:1-debian&amp;quot;.&lt;/p&gt;&lt;h3 id=&quot;websocket-connection-issues-with-reverse-proxy&quot;&gt;WebSocket Connection Issues with Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#websocket-connection-issues-with-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When using a reverse proxy, WebSocket connections may fail if not properly configured. Ensure your reverse proxy configuration includes the appropriate WebSocket headers:&lt;/p&gt;&lt;p&gt;For Nginx:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For Apache:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:3001/$1 [P,L]
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Caddy handles WebSocket correctly by default with the simple configuration provided earlier.&lt;/p&gt;&lt;h2 id=&quot;security-best-practices&quot;&gt;Security Best Practices&lt;a class=&quot;h-anchor&quot; href=&quot;#security-best-practices&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;use-a-strong-admin-password&quot;&gt;Use a Strong Admin Password&lt;a class=&quot;h-anchor&quot; href=&quot;#use-a-strong-admin-password&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a secure, unique password for your Uptime Kuma admin account.&lt;/p&gt;&lt;h3 id=&quot;implement-a-reverse-proxy-with-ssl&quot;&gt;Implement a Reverse Proxy with SSL&lt;a class=&quot;h-anchor&quot; href=&quot;#implement-a-reverse-proxy-with-ssl&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;As described in the Caddy setup section, always use HTTPS in production environments.&lt;/p&gt;&lt;h3 id=&quot;limit-access-with-firewall-rules&quot;&gt;Limit Access with Firewall Rules&lt;a class=&quot;h-anchor&quot; href=&quot;#limit-access-with-firewall-rules&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Only open the necessary ports on your server:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Port 3001 if accessing Uptime Kuma directly (development only)&lt;/li&gt;&lt;li&gt;Ports 80 and 443 if using a reverse proxy (recommended)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;consider-ip-restrictions&quot;&gt;Consider IP Restrictions&lt;a class=&quot;h-anchor&quot; href=&quot;#consider-ip-restrictions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If using Nginx or Apache as a reverse proxy, consider implementing IP restrictions to limit administrative access.&lt;/p&gt;&lt;h2 id=&quot;maintenance-tasks&quot;&gt;Maintenance Tasks&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-tasks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;regular-updates&quot;&gt;Regular Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#regular-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check for updates regularly and follow the update procedure provided earlier. Uptime Kuma development is active, and updates often include security fixes and new features.&lt;/p&gt;&lt;h3 id=&quot;log-monitoring&quot;&gt;Log Monitoring&lt;a class=&quot;h-anchor&quot; href=&quot;#log-monitoring&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check container logs periodically for warnings or errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs uptime-kuma
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;database-maintenance&quot;&gt;Database Maintenance&lt;a class=&quot;h-anchor&quot; href=&quot;#database-maintenance&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Uptime Kuma uses SQLite for data storage. No regular database maintenance is typically required, but creating periodic backups is recommended.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You&amp;#39;ve successfully installed, secured, and configured Uptime Kuma on Ubuntu 20.04 or newer. By following the Docker or Docker Compose installation method and implementing a reverse proxy with SSL, you now have a robust monitoring solution for your websites and services.&lt;/p&gt;&lt;p&gt;With proper maintenance, backup procedures, and security practices, your Uptime Kuma installation will provide reliable uptime monitoring for your infrastructure. Remember to check for updates regularly and implement the additional security measures recommended in this guide to ensure your monitoring system remains secure and effective.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing and Securing Mastodon with Docker on Ubuntu</title><link>https://diylabhub.com/complete-guide-to-installing-and-securing-mastodon-with-docker-on-ubuntu/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-securing-mastodon-with-docker-on-ubuntu/</guid><pubDate>Sun, 09 Mar 2025 08:56:14 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Mastodon is an open-source, decentralized social network that gives users control over their data and content. Unlike centralized platforms such as Twitter, Mastodon operates on a federated model where independent servers (instances) connect to form a larger network.&lt;/p&gt;&lt;p&gt;Docker provides an excellent deployment method for Mastodon because it offers:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Isolation between components&lt;/li&gt;&lt;li&gt;Consistency across environments&lt;/li&gt;&lt;li&gt;Simplified management and maintenance&lt;/li&gt;&lt;li&gt;Easier upgrades and backups&lt;/li&gt;&lt;li&gt;Enhanced security through containerization&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This comprehensive guide will walk you through setting up your own Mastodon instance using Docker on Ubuntu 20.04 or newer.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Instruction Layout&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Mastodon--385x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning installation, ensure you have:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A server running Ubuntu 20.04 or newer&lt;/li&gt;&lt;li&gt;At least 2GB of RAM and 2 CPU cores (4GB+ recommended for production)&lt;/li&gt;&lt;li&gt;At least 20GB of free storage space (more for a growing instance)&lt;/li&gt;&lt;li&gt;A registered domain name pointing to your server&lt;/li&gt;&lt;li&gt;Basic familiarity with Linux command line&lt;/li&gt;&lt;li&gt;Root or sudo access to your server&lt;/li&gt;&lt;li&gt;An SMTP provider for sending emails (required for account verification)&lt;/li&gt;&lt;li&gt;Ports 80 and 443 open on your firewall for HTTP/HTTPS traffic&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;hardware-recommendations&quot;&gt;Hardware Recommendations&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-recommendations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For optimal performance, consider these resource guidelines:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Minimum&lt;/strong&gt;: 2GB RAM, 2 CPU cores, 20GB storage&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Recommended&lt;/strong&gt;: 4GB RAM, 2-4 CPU cores, 40GB+ storage&lt;/li&gt;&lt;li&gt;&lt;strong&gt;For larger instances&lt;/strong&gt;: 8GB+ RAM, 4+ CPU cores, 100GB+ storage with separate database server&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;networking-requirements&quot;&gt;Networking Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#networking-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Your server must have these ports accessible:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Port 22: SSH access (restrict to your IP if possible)&lt;/li&gt;&lt;li&gt;Port 80: HTTP (for initial setup and redirecting to HTTPS)&lt;/li&gt;&lt;li&gt;Port 443: HTTPS (for secure access to your instance)&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;system-preparation&quot;&gt;System Preparation&lt;a class=&quot;h-anchor&quot; href=&quot;#system-preparation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;#39;s start by updating your system and installing essential utilities.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates your package lists and upgrades installed packages to their latest versions.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y ca-certificates curl gnupg lsb-release apt-transport-https software-properties-common
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs necessary utilities for adding repositories and downloading packages securely.&lt;/p&gt;&lt;h3 id=&quot;setting-up-firewall-ufw&quot;&gt;Setting Up Firewall (UFW)&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-firewall-ufw&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Configure a basic firewall to protect your server:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Checks if the firewall is active. If the output shows &amp;quot;inactive,&amp;quot; proceed with the following steps.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow OpenSSH
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Allows SSH connections so you don&amp;#39;t get locked out of your server.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow 80/tcp
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Opens HTTP port for initial setup and Let&amp;#39;s Encrypt verification.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow 443/tcp
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Opens HTTPS port for secure web traffic.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Activates the firewall. You&amp;#39;ll be prompted to confirm with &amp;#39;y&amp;#39; - this might disconnect your SSH session if you haven&amp;#39;t allowed OpenSSH first.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verifies the firewall is active and shows the allowed services.&lt;/p&gt;&lt;h2 id=&quot;installing-docker-and-docker-compose&quot;&gt;Installing Docker and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-docker-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker allows us to run Mastodon and its dependencies in isolated containers.&lt;/p&gt;&lt;h3 id=&quot;install-docker&quot;&gt;Install Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Removes any old Docker versions that might conflict with the installation.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Downloads and installs Docker&amp;#39;s official GPG key for package verification.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Adds Docker&amp;#39;s official repository to your system.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Updates package lists to include Docker packages.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker-ce docker-ce-cli containerd.io
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs Docker Engine and related packages.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verifies Docker is running. You should see &amp;quot;active (running)&amp;quot; in the output.&lt;/p&gt;&lt;h3 id=&quot;install-docker-compose-plugin&quot;&gt;Install Docker Compose Plugin&lt;a class=&quot;h-anchor&quot; href=&quot;#install-docker-compose-plugin&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs the Docker Compose plugin through apt.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verifies Docker Compose is installed properly. You should see version information.&lt;/p&gt;&lt;h3 id=&quot;add-your-user-to-docker-group-optional&quot;&gt;Add Your User to Docker Group (Optional)&lt;a class=&quot;h-anchor&quot; href=&quot;#add-your-user-to-docker-group-optional&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This step allows you to run Docker commands without sudo.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Adds your current user to the Docker group. You&amp;#39;ll need to log out and back in for this to take effect.&lt;/p&gt;&lt;h2 id=&quot;setting-up-mastodon&quot;&gt;Setting Up Mastodon&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-mastodon&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now let&amp;#39;s create the directory structure and download Mastodon.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir -p /opt/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a directory for Mastodon files.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown $USER:$USER /opt/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Gives your user ownership of the Mastodon directory.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd /opt/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Changes to the Mastodon directory.&lt;/p&gt;&lt;h3 id=&quot;create-directory-structure&quot;&gt;Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p public/system
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a directory for user uploads and other files.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p postgres
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a directory to store PostgreSQL data.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p redis
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a directory to store Redis data.&lt;/p&gt;&lt;h3 id=&quot;download-mastodon-docker-configuration&quot;&gt;Download Mastodon Docker Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#download-mastodon-docker-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -L https://raw.githubusercontent.com/mastodon/mastodon/main/docker-compose.yml -o docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Downloads the official Mastodon docker-compose.yml file.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -L https://raw.githubusercontent.com/mastodon/mastodon/main/.env.production.sample -o .env.production
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Downloads the sample environment configuration file.&lt;/p&gt;&lt;h3 id=&quot;configure-docker-compose&quot;&gt;Configure Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now we need to modify the docker-compose.yml file to use prebuilt images instead of building locally.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sed -i &amp;#39;s/^  build: .$/  # build: /&amp;#39; docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Comments out the build directive for each service.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sed -i &amp;#39;s/^  image: tootsuite\/mastodon$/  image: tootsuite\/mastodon:latest/&amp;#39; docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Changes the image reference to use the latest prebuilt image. For production, you might want to specify a specific version.&lt;/p&gt;&lt;h3 id=&quot;setting-file-permissions&quot;&gt;Setting File Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-file-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R 991:991 public
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Sets the correct permissions for the public directory. 991 is the default user ID for Mastodon in the Docker container.&lt;/p&gt;&lt;h2 id=&quot;configuring-mastodon&quot;&gt;Configuring Mastodon&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-mastodon&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now we&amp;#39;ll set up the configuration file for Mastodon.&lt;/p&gt;&lt;h3 id=&quot;generate-secrets&quot;&gt;Generate Secrets&lt;a class=&quot;h-anchor&quot; href=&quot;#generate-secrets&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web rake secret
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Generates a random string for the SECRET_KEY_BASE. Copy this output.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web rake secret
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Run this command again to generate a random string for OTP_SECRET. Copy this output.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web bundle exec rake mastodon:webpush:generate_vapid_key
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Generates VAPID keys for Web Push notifications. Copy both the private and public keys.&lt;/p&gt;&lt;h3 id=&quot;edit-the-environment-configuration&quot;&gt;Edit the Environment Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#edit-the-environment-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now you need to edit the .env.production file to configure your Mastodon instance:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano .env.production
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Opens the environment file for editing. You&amp;#39;ll need to update the following settings:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;LOCAL_DOMAIN: Set to your domain name&lt;/li&gt;&lt;li&gt;DB_HOST: Set to &amp;quot;db&amp;quot;&lt;/li&gt;&lt;li&gt;DB_USER: Set to &amp;quot;postgres&amp;quot;&lt;/li&gt;&lt;li&gt;DB_NAME: Set to &amp;quot;postgres&amp;quot;&lt;/li&gt;&lt;li&gt;DB_PASS: Leave empty for this setup&lt;/li&gt;&lt;li&gt;REDIS_HOST: Set to &amp;quot;redis&amp;quot;&lt;/li&gt;&lt;li&gt;SECRET_KEY_BASE: Paste the first secret generated earlier&lt;/li&gt;&lt;li&gt;OTP_SECRET: Paste the second secret generated earlier&lt;/li&gt;&lt;li&gt;VAPID_PRIVATE_KEY and VAPID_PUBLIC_KEY: Paste the VAPID keys generated earlier&lt;/li&gt;&lt;li&gt;SMTP settings: Fill in with your email provider&amp;#39;s details&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;smtp-configuration-example&quot;&gt;SMTP Configuration Example&lt;a class=&quot;h-anchor&quot; href=&quot;#smtp-configuration-example&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Here&amp;#39;s an example SMTP configuration using Gmail (you should use an application-specific password):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_LOGIN=your_email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_FROM_ADDRESS=Mastodon 
SMTP_AUTH_METHOD=plain
SMTP_OPENSSL_VERIFY_MODE=none
SMTP_ENABLE_STARTTLS=auto
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;initial-setup&quot;&gt;Initial Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#initial-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that we have the configuration in place, let&amp;#39;s set up the database and create an admin account.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web bundle exec rake mastodon:setup
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This interactive command will verify your configuration, set up the database, and prompt you to create an admin user.&lt;/p&gt;&lt;p&gt;When prompted:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Confirm your configuration settings&lt;/li&gt;&lt;li&gt;Choose to create an admin user when asked&lt;/li&gt;&lt;li&gt;Enter your desired username, email, and password for the admin account&lt;/li&gt;&lt;li&gt;For other prompts, accept the default values by pressing Enter&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;starting-mastodon&quot;&gt;Starting Mastodon&lt;a class=&quot;h-anchor&quot; href=&quot;#starting-mastodon&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now we&amp;#39;re ready to start Mastodon:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Starts all Mastodon services in detached mode. This may take a few minutes the first time.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Checks that all services are running. All containers should show &amp;quot;Up&amp;quot; status.&lt;/p&gt;&lt;h2 id=&quot;setting-up-nginx-as-a-reverse-proxy&quot;&gt;Setting Up Nginx as a Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-nginx-as-a-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To expose Mastodon securely to the internet, we&amp;#39;ll set up Nginx as a reverse proxy with HTTPS.&lt;/p&gt;&lt;h3 id=&quot;install-nginx-and-certbot&quot;&gt;Install Nginx and Certbot&lt;a class=&quot;h-anchor&quot; href=&quot;#install-nginx-and-certbot&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y nginx certbot python3-certbot-nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs Nginx web server and Certbot for obtaining SSL certificates.&lt;/p&gt;&lt;h3 id=&quot;create-nginx-configuration&quot;&gt;Create Nginx Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#create-nginx-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/nginx/sites-available/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a new Nginx configuration file for Mastodon.&lt;/p&gt;&lt;p&gt;Paste the following configuration, replacing yourdomain.com with your actual domain:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com;
    
    location /.well-known/acme-challenge/ {
        root /var/www/html;
    }
    
    location / {
        return 301 https://$host$request_uri;
    }
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit (Ctrl+X, then Y, then Enter).&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Enables the Nginx configuration by creating a symbolic link.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nginx -t
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Tests the Nginx configuration for syntax errors.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl reload nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Reloads Nginx to apply the new configuration.&lt;/p&gt;&lt;h3 id=&quot;obtain-ssl-certificate&quot;&gt;Obtain SSL Certificate&lt;a class=&quot;h-anchor&quot; href=&quot;#obtain-ssl-certificate&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo certbot --nginx -d yourdomain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Runs Certbot to obtain an SSL certificate for your domain. Follow the prompts to complete the process.&lt;/p&gt;&lt;p&gt;After Certbot completes, it will update your Nginx configuration with SSL settings. Verify that the configuration was updated correctly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/nginx/sites-available/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The file should now include SSL settings and a server block for HTTPS. If needed, adjust the configuration to include proper proxy settings:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name yourdomain.com;
    
    # SSL settings added by Certbot
    
    # Mastodon proxy settings
    location / {
        proxy_pass http://127.0.0.1:3000;
        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 https;
        proxy_set_header Proxy &amp;quot;&amp;quot;;
        
        proxy_buffering off;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
        
        client_max_body_size 16m;
    }
    
    location /api/v1/streaming {
        proxy_pass http://127.0.0.1:4000;
        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 https;
        proxy_set_header Proxy &amp;quot;&amp;quot;;
        
        proxy_buffering off;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
    }
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nginx -t
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Tests the updated Nginx configuration.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl reload nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Reloads Nginx to apply the changes.&lt;/p&gt;&lt;h2 id=&quot;security-hardening&quot;&gt;Security Hardening&lt;a class=&quot;h-anchor&quot; href=&quot;#security-hardening&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;#39;s add additional security measures to protect your Mastodon instance.&lt;/p&gt;&lt;h3 id=&quot;configure-docker-container-security&quot;&gt;Configure Docker Container Security&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-docker-container-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Edit the docker-compose.yml file to improve container security:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following security options to each service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;security_opt:
  - no-new-privileges:true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This prevents processes in the container from gaining additional privileges.&lt;/p&gt;&lt;h3 id=&quot;set-up-fail2ban-to-protect-against-brute-force-attacks&quot;&gt;Set Up Fail2ban to Protect Against Brute Force Attacks&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-fail2ban-to-protect-against-brute-force-attacks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y fail2ban
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Installs Fail2ban, which helps protect against brute force login attempts.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/fail2ban/jail.local
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a configuration file for Fail2ban.&lt;/p&gt;&lt;p&gt;Add the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[sshd]
enabled = true
maxretry = 3
findtime = 1h
bantime = 24h

[nginx-http-auth]
enabled = true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart fail2ban
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restarts Fail2ban to apply the configuration.&lt;/p&gt;&lt;h2 id=&quot;data-persistence-and-backups&quot;&gt;Data Persistence and Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence-and-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ensuring data persistence and regular backups is crucial for any production service.&lt;/p&gt;&lt;h3 id=&quot;create-a-backup-script&quot;&gt;Create a Backup Script&lt;a class=&quot;h-anchor&quot; href=&quot;#create-a-backup-script&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano /opt/mastodon/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a backup script.&lt;/p&gt;&lt;p&gt;Add the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
# Mastodon backup script
BACKUP_DIR=&amp;quot;/opt/mastodon/backups&amp;quot;
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_FILE=&amp;quot;mastodon_backup_$DATE.tar.gz&amp;quot;

# Create backup directory if it doesn&amp;#39;t exist
mkdir -p $BACKUP_DIR

# Go to Mastodon directory
cd /opt/mastodon

# Create database backup
docker compose exec -T db pg_dump -U postgres postgres &amp;gt; $BACKUP_DIR/mastodon_db_$DATE.sql

# Backup configuration files
cp .env.production $BACKUP_DIR/.env.production_$DATE

# Backup public uploads
tar -czf $BACKUP_DIR/$BACKUP_FILE public/system

# Keep only the last 7 backups
find $BACKUP_DIR -name &amp;quot;mastodon_backup_*&amp;quot; -type f -mtime +7 -delete
find $BACKUP_DIR -name &amp;quot;mastodon_db_*&amp;quot; -type f -mtime +7 -delete
find $BACKUP_DIR -name &amp;quot;.env.production_*&amp;quot; -type f -mtime +7 -delete

echo &amp;quot;Backup completed: $BACKUP_FILE&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x /opt/mastodon/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Makes the backup script executable.&lt;/p&gt;&lt;h3 id=&quot;set-up-a-cron-job-for-regular-backups&quot;&gt;Set Up a Cron Job for Regular Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-a-cron-job-for-regular-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo crontab -e
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Opens the root crontab file.&lt;/p&gt;&lt;p&gt;Add the following line to run backups daily at 2 AM:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;0 2 * * * /opt/mastodon/backup.sh &amp;gt; /var/log/mastodon_backup.log 2&amp;gt;&amp;amp;1
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and exit.&lt;/p&gt;&lt;h2 id=&quot;common-issues-and-troubleshooting&quot;&gt;Common Issues and Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Here are the most frequent issues users encounter and their solutions.&lt;/p&gt;&lt;h3 id=&quot;checking-logs&quot;&gt;Checking Logs&lt;a class=&quot;h-anchor&quot; href=&quot;#checking-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To check logs for troubleshooting:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Shows logs from all services.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs web
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Shows logs from the web service only.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs -f
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Shows logs and follows them in real-time (press Ctrl+C to exit).&lt;/p&gt;&lt;h3 id=&quot;common-issues-and-solutions&quot;&gt;Common Issues and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;database-connection-issues&quot;&gt;Database Connection Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#database-connection-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Mastodon cannot connect to the database.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs web | grep &amp;quot;PG::ConnectionBad&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Check DB_HOST, DB_USER, and DB_PASS in .env.production. Ensure they match the configuration in docker-compose.yml.&lt;/p&gt;&lt;h4 id=&quot;redis-connection-issues&quot;&gt;Redis Connection Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#redis-connection-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Mastodon cannot connect to Redis.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs web | grep &amp;quot;Redis::CannotConnectError&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Verify REDIS_HOST in .env.production is set to &amp;quot;redis&amp;quot;.&lt;/p&gt;&lt;h4 id=&quot;email-not-working&quot;&gt;Email Not Working&lt;a class=&quot;h-anchor&quot; href=&quot;#email-not-working&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Registration emails and notifications aren&amp;#39;t being sent.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs sidekiq | grep &amp;quot;SMTP&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Check your SMTP configuration in .env.production. Some providers may require enabling less secure apps or generating app-specific passwords.&lt;/p&gt;&lt;h4 id=&quot;insufficient-disk-space&quot;&gt;Insufficient Disk Space&lt;a class=&quot;h-anchor&quot; href=&quot;#insufficient-disk-space&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Docker operations fail due to low disk space.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;df -h
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Clean unused Docker resources:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker system prune -a
&lt;/pre&gt;&lt;/figure&gt;&lt;h4 id=&quot;web-push-not-working&quot;&gt;Web Push Not Working&lt;a class=&quot;h-anchor&quot; href=&quot;#web-push-not-working&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Push notifications don&amp;#39;t work.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;: Check if VAPID keys are properly configured:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;grep VAPID .env.production
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: If keys are missing or invalid, regenerate them:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web bundle exec rake mastodon:webpush:generate_vapid_key
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Update the values in .env.production and restart Mastodon.&lt;/p&gt;&lt;h2 id=&quot;maintenance-tasks&quot;&gt;Maintenance Tasks&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-tasks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular maintenance ensures your Mastodon instance stays healthy and secure.&lt;/p&gt;&lt;h3 id=&quot;updating-mastodon&quot;&gt;Updating Mastodon&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-mastodon&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd /opt/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Changes to the Mastodon directory.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose pull
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Pulls the latest container images.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose down
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Stops all containers.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Starts containers with updated images.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web rails db:migrate
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Runs database migrations after updating.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web rails assets:precompile
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Recompiles static assets after updating.&lt;/p&gt;&lt;h3 id=&quot;monitoring-server-health&quot;&gt;Monitoring Server Health&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-server-health&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;htop
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Monitors system resource usage in real-time. (Install with &lt;code&gt;sudo apt install htop&lt;/code&gt; if not available)&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker stats
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Shows resource usage of Docker containers.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;df -h
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Checks disk space usage.&lt;/p&gt;&lt;h3 id=&quot;user-management&quot;&gt;User Management&lt;a class=&quot;h-anchor&quot; href=&quot;#user-management&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To create a new administrator account:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web bin/tootctl accounts create username --email=email@example.com --confirmed --role=admin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Creates a new admin user with the specified username and email.&lt;/p&gt;&lt;p&gt;To moderate content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose run --rm web bin/tootctl media remove
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Removes remote media that&amp;#39;s no longer referenced.&lt;/p&gt;&lt;h2 id=&quot;known-issues-and-workarounds&quot;&gt;Known Issues and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-issues-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;high-memory-usage&quot;&gt;High Memory Usage&lt;a class=&quot;h-anchor&quot; href=&quot;#high-memory-usage&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Mastodon services, especially Sidekiq, can use a lot of memory on low-spec servers.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;: Adjust the concurrency in docker-compose.yml for the Sidekiq service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Find the Sidekiq section and add an environment variable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;environment:
  - SIDEKIQ_CONCURRENCY=5
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and restart:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose restart sidekiq
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;slow-initial-load-times&quot;&gt;Slow Initial Load Times&lt;a class=&quot;h-anchor&quot; href=&quot;#slow-initial-load-times&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Initial page loads can be slow.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;: Enable caching by adding these to .env.production:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;CACHE_REDIS_HOST=redis
CACHE_REDIS_PORT=6379
CACHE_REDIS_DB=0
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;file-upload-size-limitations&quot;&gt;File Upload Size Limitations&lt;a class=&quot;h-anchor&quot; href=&quot;#file-upload-size-limitations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Users cannot upload large files.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;: Adjust Nginx client_max_body_size:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/nginx/sites-available/mastodon
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Find and modify the client_max_body_size directive:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;client_max_body_size 40m;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and reload Nginx:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl reload nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Congratulations! You now have a fully functioning Mastodon instance running on Docker with security best practices in place. This setup provides a solid foundation for running your own social media server while maintaining control over your data and user experience.&lt;/p&gt;&lt;p&gt;Remember to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Regularly update your system and Mastodon&lt;/li&gt;&lt;li&gt;Monitor server resources&lt;/li&gt;&lt;li&gt;Keep backups of your data&lt;/li&gt;&lt;li&gt;Stay informed about security advisories&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;By following these practices, you&amp;#39;ll ensure a stable, secure, and reliable Mastodon experience for you and your users.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>The Complete Guide to Installing and Running Ghost CMS with Docker on Ubuntu 20.04 and Newer</title><link>https://diylabhub.com/the-complete-guide-to-installing-and-running-ghost-cms-with-docker-on-ubuntu-20-04-and-newer/</link><guid isPermaLink="true">https://diylabhub.com/the-complete-guide-to-installing-and-running-ghost-cms-with-docker-on-ubuntu-20-04-and-newer/</guid><pubDate>Sun, 09 Mar 2025 06:52:06 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Ghost is an open-source, professional publishing platform designed to create blogs, magazines, and news sites. Originally launched in 2013 as a streamlined alternative to WordPress, Ghost focuses on content creation with a clean, distraction-free interface. This comprehensive guide walks you through installing and securing Ghost CMS using Docker on Ubuntu 20.04 or newer versions. Docker provides an isolated, consistent environment that makes deployment straightforward and maintenance simpler. By containerizing Ghost, you&amp;#39;ll gain the benefits of easy updates, consistent environments, and simplified backups while maintaining robust security practices.&lt;/p&gt;&lt;h2 id=&quot;understanding-ghost-cms-and-docker&quot;&gt;Understanding Ghost CMS and Docker&lt;a class=&quot;h-anchor&quot; href=&quot;#understanding-ghost-cms-and-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ghost CMS stands out as a modern, JavaScript-based publishing platform powered by Node.js. It offers a markdown-focused editor, built-in SEO tools, and native subscription capabilities, making it ideal for professional bloggers, journalists, and content creators. Ghost emphasizes performance and simplicity, providing all essential publishing features without the complexity found in some other content management systems.&lt;/p&gt;&lt;p&gt;Docker revolutionizes application deployment by packaging software and dependencies into standardized containers. This approach eliminates environment inconsistencies and simplifies management. For Ghost specifically, Docker eliminates the need to manually configure Node.js, database systems, and other dependencies. You can deploy, update, and migrate your Ghost blog with minimal technical overhead.&lt;/p&gt;&lt;p&gt;When combined, Ghost and Docker create a powerful, flexible publishing platform that&amp;#39;s easy to maintain and scale. This guide uses Docker Compose V2 (the &lt;code&gt;docker compose&lt;/code&gt; command) rather than the deprecated Docker Compose V1 (&lt;code&gt;docker-compose&lt;/code&gt;), ensuring you&amp;#39;re following current best practices as of March 2025.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Instruction layout&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/Ghost-CMS-Instruction_Layout-310x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h2 id=&quot;prerequisites-and-system-requirements&quot;&gt;Prerequisites and System Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites-and-system-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning the installation process, ensure your system meets the following requirements:&lt;/p&gt;&lt;h3 id=&quot;hardware-requirements&quot;&gt;Hardware Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#hardware-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;CPU: At least 1 dedicated core (2+ cores recommended for production)&lt;/li&gt;&lt;li&gt;RAM: Minimum 1GB (2GB or more recommended for production use)&lt;/li&gt;&lt;li&gt;Storage: At least 10GB free space for Docker images, database, and content&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;software-requirements&quot;&gt;Software Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#software-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer (22.04 LTS or 24.04 LTS)&lt;/li&gt;&lt;li&gt;A non-root user with sudo privileges&lt;/li&gt;&lt;li&gt;Updated system packages&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;A domain name pointing to your server (for production use)&lt;/li&gt;&lt;li&gt;Ability to open ports 80 and 443 for HTTP/HTTPS traffic&lt;/li&gt;&lt;li&gt;Unrestricted outbound internet access to pull Docker images&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;required-knowledge&quot;&gt;Required Knowledge&lt;a class=&quot;h-anchor&quot; href=&quot;#required-knowledge&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Basic familiarity with terminal commands&lt;/li&gt;&lt;li&gt;Understanding of web hosting concepts&lt;/li&gt;&lt;li&gt;Ability to follow step-by-step instructions&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;initial-system-setup&quot;&gt;Initial System Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#initial-system-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Start by ensuring your Ubuntu system is fully updated. This prevents package conflicts and security vulnerabilities during installation.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command refreshes your package lists, ensuring you have access to the latest software versions. If this fails, check your internet connection or try changing your Ubuntu mirror.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This upgrades all installed packages to their latest versions. The &lt;code&gt;-y&lt;/code&gt; flag automatically answers &amp;quot;yes&amp;quot; to the upgrade prompt. This process may take several minutes depending on your internet speed and how many packages need updating.&lt;/p&gt;&lt;p&gt;Next, install essential tools that will be needed throughout this process:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y ca-certificates curl gnupg lsb-release
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs certificate authority certificates for secure connections, curl for downloading files, gnupg for verifying package signatures, and lsb-release for detecting your Ubuntu version. These are prerequisites for Docker installation.&lt;/p&gt;&lt;h2 id=&quot;configuring-ufw-firewall&quot;&gt;Configuring UFW Firewall&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-ufw-firewall&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ubuntu comes with Uncomplicated Firewall (UFW), which provides a user-friendly interface for managing firewall rules. Start by checking if the firewall is active:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If the firewall is inactive, you&amp;#39;ll see &amp;quot;Status: inactive&amp;quot;. If it&amp;#39;s already active, you&amp;#39;ll see a list of allowed connections.&lt;/p&gt;&lt;p&gt;Allow SSH connections to prevent locking yourself out when enabling the firewall:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow OpenSSH
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures you maintain SSH access after enabling the firewall. Without this rule, you might lose connection to your server and require console access to regain control.&lt;/p&gt;&lt;p&gt;Next, allow HTTP and HTTPS traffic, which will be necessary for accessing your Ghost blog:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow 80
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This opens port 80 for HTTP traffic. This port is necessary for initial Let&amp;#39;s Encrypt certificate verification and for redirecting users to the secure HTTPS version of your site.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow 443
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This opens port 443 for HTTPS traffic, which will be used for encrypted connections to your Ghost blog. All production traffic will go through this port.&lt;/p&gt;&lt;p&gt;Now, enable the firewall:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You&amp;#39;ll receive a warning that enabling the firewall might disrupt existing SSH connections. Type &amp;#39;y&amp;#39; and press Enter to continue. Since you&amp;#39;ve allowed OpenSSH, your current connection shouldn&amp;#39;t be affected.&lt;/p&gt;&lt;p&gt;Verify that the firewall is properly configured:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This should display a list of allowed services and ports, including OpenSSH, port 80, and port 443. If any are missing, add them using the &lt;code&gt;sudo ufw allow&lt;/code&gt; command.&lt;/p&gt;&lt;h2 id=&quot;installing-docker-and-docker-compose&quot;&gt;Installing Docker and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-docker-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker will manage the containers that run your Ghost CMS and supporting services. First, uninstall any older versions of Docker that might cause conflicts:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes any previously installed Docker packages. If none are installed, you&amp;#39;ll see a message that these packages weren&amp;#39;t found, which is fine.&lt;/p&gt;&lt;p&gt;Create a directory for Docker&amp;#39;s GPG key:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir -p /etc/apt/keyrings
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory to store repository keys. If the directory already exists, this command will have no effect.&lt;/p&gt;&lt;p&gt;Download and add Docker&amp;#39;s official GPG key:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads Docker&amp;#39;s verification key and adds it to your system, enabling you to securely download Docker packages. If you encounter a GPG error, try running &lt;code&gt;sudo apt install gnupg&lt;/code&gt; first.&lt;/p&gt;&lt;p&gt;Add the Docker repository to your system:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds the appropriate Docker repository for your Ubuntu version and system architecture. If this command fails, check if the lsb-release package is installed.&lt;/p&gt;&lt;p&gt;Update apt package list to include the Docker repository:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This refreshes your package lists to include Docker packages from the newly added repository.&lt;/p&gt;&lt;p&gt;Install Docker Engine, containerd, and Docker Compose:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Docker Engine, Docker CLI tools, containerd runtime, and the Docker Compose plugin. If this fails with dependency errors, run &lt;code&gt;sudo apt --fix-broken install&lt;/code&gt; and try again.&lt;/p&gt;&lt;p&gt;Verify that Docker is properly installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker --version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This should display the installed Docker version. If you get a &amp;quot;command not found&amp;quot; error, try logging out and back in or rebooting your system.&lt;/p&gt;&lt;p&gt;Verify that Docker Compose V2 is installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This should show the installed Docker Compose version. Note that we&amp;#39;re using &lt;code&gt;docker compose&lt;/code&gt; (with a space), which is the current Compose V2 syntax, not the older &lt;code&gt;docker-compose&lt;/code&gt; command.&lt;/p&gt;&lt;p&gt;Add your user to the Docker group to avoid needing sudo for Docker commands:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This adds your current user to the Docker group, allowing you to run Docker commands without sudo. You&amp;#39;ll need to log out and back in for this change to take effect.&lt;/p&gt;&lt;p&gt;Verify Docker is working properly by running a test container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This runs a simple test container that confirms Docker is installed and functioning correctly. If successful, you&amp;#39;ll see a message that your installation appears to be working correctly.&lt;/p&gt;&lt;h2 id=&quot;installing-certbot-for-ssl-certificates&quot;&gt;Installing Certbot for SSL Certificates&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-certbot-for-ssl-certificates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Secure your Ghost blog with free SSL certificates from Let&amp;#39;s Encrypt using Certbot:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo snap install core
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures the core snap is installed and up-to-date. Snap is Ubuntu&amp;#39;s package management system that comes pre-installed on Ubuntu 20.04 and newer.&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo snap refresh core
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates the core snap package to the latest version. This step helps avoid conflicts with Certbot installation.&lt;/p&gt;&lt;p&gt;Remove any previously installed Certbot packages:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt remove certbot
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes any previous Certbot installations that might conflict with the snap version. If Certbot wasn&amp;#39;t previously installed, this command has no effect.&lt;/p&gt;&lt;p&gt;Install Certbot using Snap:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo snap install --classic certbot
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the latest version of Certbot. The &lt;code&gt;--classic&lt;/code&gt; flag gives Certbot the permissions it needs to manage your certificates.&lt;/p&gt;&lt;p&gt;Create a symbolic link to make Certbot easily accessible:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ln -s /snap/bin/certbot /usr/bin/certbot
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This makes the Certbot command available system-wide. If this command fails, the link may already exist.&lt;/p&gt;&lt;h2 id=&quot;setting-up-ghost-with-docker-compose&quot;&gt;Setting Up Ghost with Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-ghost-with-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now you&amp;#39;re ready to set up Ghost using Docker Compose. Create a directory for your Ghost installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/ghost-blog
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory to store your Ghost configuration and content. The &lt;code&gt;-p&lt;/code&gt; flag ensures parent directories are created if they don&amp;#39;t exist.&lt;/p&gt;&lt;p&gt;Change to the new directory:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/ghost-blog
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a Docker Compose configuration file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This opens the nano text editor to create a new Docker Compose file. If you don&amp;#39;t have nano, you can install it with &lt;code&gt;sudo apt install nano&lt;/code&gt; or use any other text editor.&lt;/p&gt;&lt;p&gt;Add the following configuration, replacing &lt;code&gt;yourdomain.com&lt;/code&gt; with your actual domain name and using strong, unique passwords:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;version: &amp;#39;3.1&amp;#39;

services:
  ghost:
    image: ghost:latest
    restart: always
    environment:
      url: https://yourdomain.com
      database__client: mysql
      database__connection__host: db
      database__connection__user: ghost
      database__connection__password: YourStrongPasswordHere
      database__connection__database: ghost
      # Set Node.js to production mode
      NODE_ENV: production
    volumes:
      - ./ghost-content:/var/lib/ghost/content
    depends_on:
      - db
    networks:
      - ghost_network

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: YourMySQLRootPasswordHere
      MYSQL_DATABASE: ghost
      MYSQL_USER: ghost
      MYSQL_PASSWORD: YourStrongPasswordHere
    volumes:
      - ./mysql-data:/var/lib/mysql
    networks:
      - ghost_network

networks:
  ghost_network:
    driver: bridge
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save the file by pressing Ctrl+X, then Y, then Enter. This configuration creates two containers: one for Ghost and one for MySQL, with persistent storage for both.&lt;/p&gt;&lt;p&gt;Create directories for persistent storage:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ghost-content mysql-data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates directories that will be mounted as volumes to store Ghost content and MySQL data. If these directories exist, this command has no effect.&lt;/p&gt;&lt;p&gt;Set appropriate permissions for these directories:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R 1000:1000 ghost-content
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets the correct ownership for the Ghost content directory. Ghost runs as user ID 1000 inside the container, so this ensures proper file access.&lt;/p&gt;&lt;p&gt;Start the Ghost application:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts the Ghost and MySQL containers in detached mode. The &lt;code&gt;-d&lt;/code&gt; flag runs containers in the background. The initial startup might take a few minutes as Docker downloads the required images.&lt;/p&gt;&lt;p&gt;Check if the containers are running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows the status of your containers. Both should show &amp;quot;Up&amp;quot; under the Status column. If any container shows an error or keeps restarting, check the logs with &lt;code&gt;docker compose logs&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;obtaining-ssl-certificates&quot;&gt;Obtaining SSL Certificates&lt;a class=&quot;h-anchor&quot; href=&quot;#obtaining-ssl-certificates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before configuring your web server, you need to obtain SSL certificates. Ensure your domain is pointed to your server&amp;#39;s IP address before continuing.&lt;/p&gt;&lt;p&gt;Temporarily stop any running web servers to free port 80:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl stop nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This stops the Nginx service if it&amp;#39;s running. If you don&amp;#39;t have Nginx installed yet, this command will show an error which you can ignore.&lt;/p&gt;&lt;p&gt;Obtain SSL certificates for your domain:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;yourdomain.com&lt;/code&gt; with your actual domain. This command runs a temporary web server to verify your domain ownership and obtain certificates. You&amp;#39;ll be prompted to enter your email address and agree to the terms of service.&lt;/p&gt;&lt;p&gt;Verify that certificates were successfully obtained:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ls -la /etc/letsencrypt/live/yourdomain.com/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This lists the certificate files. You should see files including fullchain.pem and privkey.pem. If these files don&amp;#39;t exist, the certificate acquisition failed, and you should check Certbot&amp;#39;s output for error messages.&lt;/p&gt;&lt;h2 id=&quot;installing-and-configuring-nginx&quot;&gt;Installing and Configuring Nginx&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-and-configuring-nginx&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Nginx will act as a reverse proxy for your Ghost blog, handling SSL termination and serving static content efficiently:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the Nginx web server. If the installation fails, try running &lt;code&gt;sudo apt update&lt;/code&gt; first and ensure no other process is using port 80.&lt;/p&gt;&lt;p&gt;Create an Nginx configuration file for your Ghost blog:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/nginx/sites-available/yourdomain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;yourdomain.com&lt;/code&gt; with your actual domain name. This creates a new Nginx configuration file.&lt;/p&gt;&lt;p&gt;Add the following configuration, replacing &lt;code&gt;yourdomain.com&lt;/code&gt; with your actual domain:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;server {
    listen 80;
    listen [::]:80;
    server_name yourdomain.com www.yourdomain.com;
    
    # Redirect HTTP to HTTPS
    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name yourdomain.com www.yourdomain.com;
    
    # SSL configuration
    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers off;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:10m;
    
    # Security headers
    add_header X-Frame-Options SAMEORIGIN always;
    add_header X-Content-Type-Options nosniff always;
    add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot; always;
    add_header Strict-Transport-Security &amp;quot;max-age=63072000; includeSubDomains; preload&amp;quot; always;
    
    # Ghost Reverse Proxy
    location / {
        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;
        proxy_pass http://localhost:2368;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &amp;quot;upgrade&amp;quot;;
    }
    
    # Increase max body size for media uploads
    client_max_body_size 50M;
    
    # Optimize content caching
    location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
        proxy_pass http://localhost:2368;
        expires 30d;
        add_header Cache-Control &amp;quot;public, no-transform&amp;quot;;
    }
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save the file by pressing Ctrl+X, then Y, then Enter. This configuration redirects HTTP traffic to HTTPS and sets up a reverse proxy to your Ghost container, along with security headers and content caching.&lt;/p&gt;&lt;p&gt;Link the configuration to the enabled sites:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This activates your Nginx configuration. If this command fails, the symbolic link may already exist.&lt;/p&gt;&lt;p&gt;Test the Nginx configuration for syntax errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nginx -t
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This checks your Nginx configuration for errors. If you see &amp;quot;syntax is ok&amp;quot; and &amp;quot;test is successful&amp;quot;, proceed to the next step. If there are errors, check your configuration file for typos.&lt;/p&gt;&lt;p&gt;Restart Nginx to apply the configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This applies your new Nginx configuration. If Nginx fails to restart, check the error logs with &lt;code&gt;sudo journalctl -xe&lt;/code&gt; and verify your SSL certificate paths.&lt;/p&gt;&lt;p&gt;Check if Nginx is running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows the status of the Nginx service. It should show &amp;quot;active (running)&amp;quot;. If not, check the error output for clues about what went wrong.&lt;/p&gt;&lt;h2 id=&quot;setting-up-automatic-certificate-renewal&quot;&gt;Setting Up Automatic Certificate Renewal&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-automatic-certificate-renewal&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;#39;s Encrypt certificates expire after 90 days, so automatic renewal is essential:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status snap.certbot.renew.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This checks if the automatic renewal service is active. You should see &amp;quot;active (running)&amp;quot; or information about the next scheduled run.&lt;/p&gt;&lt;p&gt;Test the renewal process to ensure it works correctly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo certbot renew --dry-run
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This simulates the renewal process without actually replacing certificates. You should see a message indicating that the renewal simulation succeeded. If there are errors, they might relate to Nginx configuration or certificate ownership.&lt;/p&gt;&lt;h2 id=&quot;configuring-ghost-for-production&quot;&gt;Configuring Ghost for Production&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-ghost-for-production&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Ghost is running behind Nginx with SSL, you need to update some Ghost settings for production use:&lt;/p&gt;&lt;p&gt;Stop the Ghost container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose down
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This stops all containers defined in your docker-compose.yml file. Your content and database data remain safe in the persistent volumes.&lt;/p&gt;&lt;p&gt;Edit the Docker Compose file to add email configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add email configuration to the ghost service environment section:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;environment:
  # Existing environment variables...
  mail__transport: SMTP
  mail__options__service: Mailgun # or another provider like SendGrid, Postmark, etc.
  mail__options__host: smtp.mailgun.org
  mail__options__port: 587
  mail__options__auth__user: your-smtp-username
  mail__options__auth__pass: your-smtp-password
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace the SMTP details with your own email service credentials. This configures Ghost to send emails through your SMTP provider, which is essential for user invitations, password resets, and newsletters.&lt;/p&gt;&lt;p&gt;Save the file and restart the containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts your containers with the updated configuration. Check the Ghost logs for any errors related to the new configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs ghost
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows the logs from the Ghost container. Look for any error messages related to the SMTP configuration or other issues.&lt;/p&gt;&lt;h2 id=&quot;creating-a-ghost-admin-user&quot;&gt;Creating a Ghost Admin User&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-a-ghost-admin-user&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Access your Ghost blog at https://yourdomain.com/ghost to set up your admin account:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Open a web browser and navigate to https://yourdomain.com/ghost&lt;/li&gt;&lt;li&gt;Follow the on-screen instructions to create your admin account&lt;/li&gt;&lt;li&gt;Set a strong, unique password for your admin account&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;creating-backup-and-restore-scripts&quot;&gt;Creating Backup and Restore Scripts&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-backup-and-restore-scripts&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Create a backup script to regularly save your Ghost data:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano backup-ghost.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content to the script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash

# Create backup directory if it doesn&amp;#39;t exist
BACKUP_DIR=&amp;quot;./backups&amp;quot;
mkdir -p $BACKUP_DIR

# Set timestamp for backup files
TIMESTAMP=$(date +&amp;quot;%Y%m%d_%H%M%S&amp;quot;)

# Backup Ghost content
echo &amp;quot;Backing up Ghost content...&amp;quot;
tar -czf $BACKUP_DIR/ghost_content_$TIMESTAMP.tar.gz -C ./ghost-content .

# Backup MySQL database
echo &amp;quot;Backing up MySQL database...&amp;quot;
docker compose exec db sh -c &amp;#39;exec mysqldump -uroot -p&amp;quot;$MYSQL_ROOT_PASSWORD&amp;quot; ghost&amp;#39; &amp;gt; $BACKUP_DIR/ghost_db_$TIMESTAMP.sql

# Compress database backup
gzip $BACKUP_DIR/ghost_db_$TIMESTAMP.sql

echo &amp;quot;Backup completed: $BACKUP_DIR/ghost_content_$TIMESTAMP.tar.gz and $BACKUP_DIR/ghost_db_$TIMESTAMP.sql.gz&amp;quot;

# Optional: Remove backups older than 30 days
find $BACKUP_DIR -name &amp;quot;ghost_*&amp;quot; -type f -mtime +30 -delete
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save the file and make it executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x backup-ghost.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows the script to be executed. You can now run it with &lt;code&gt;./backup-ghost.sh&lt;/code&gt; to create a backup.&lt;/p&gt;&lt;p&gt;Create a restore script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano restore-ghost.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content to the script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash

if [ $# -ne 2 ]; then
  echo &amp;quot;Usage: $0 content_backup.tar.gz database_backup.sql.gz&amp;quot;
  exit 1
fi

CONTENT_BACKUP=$1
DB_BACKUP=$2

# Stop containers
docker compose down

# Restore content
echo &amp;quot;Restoring content from $CONTENT_BACKUP...&amp;quot;
rm -rf ./ghost-content/*
tar -xzf $CONTENT_BACKUP -C ./ghost-content

# Restore database
echo &amp;quot;Restoring database from $DB_BACKUP...&amp;quot;
gunzip -c $DB_BACKUP &amp;gt; ./restore_db.sql
docker compose up -d db
sleep 10  # Wait for database to start
docker compose exec db sh -c &amp;#39;exec mysql -uroot -p&amp;quot;$MYSQL_ROOT_PASSWORD&amp;quot; ghost&amp;#39; &amp;lt; ./restore_db.sql

# Start Ghost
docker compose up -d

echo &amp;quot;Restoration completed. Check your Ghost blog to verify.&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the restoration script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x restore-ghost.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set up automated backups with cron:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;crontab -e
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following line to run backups daily at 2:00 AM:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;0 2 * * * /home/username/ghost-blog/backup-ghost.sh &amp;gt;&amp;gt; /home/username/ghost-blog/backups/backup.log 2&amp;gt;&amp;amp;1
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;/home/username/ghost-blog/&lt;/code&gt; with the actual path to your Ghost directory.&lt;/p&gt;&lt;h2 id=&quot;enhancing-security&quot;&gt;Enhancing Security&lt;a class=&quot;h-anchor&quot; href=&quot;#enhancing-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Improve your Ghost installation&amp;#39;s security with these additional steps:&lt;/p&gt;&lt;p&gt;Secure MySQL by limiting network access:&lt;/p&gt;&lt;p&gt;Edit your docker-compose.yml file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following to the db service to make it only accept connections from the internal network:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;db:
  # Existing configuration...
  command: --default-authentication-plugin=mysql_native_password --bind-address=0.0.0.0 --mysqlx=0
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This disables the MySQL X Protocol and configures the authentication plugin. Save the file and restart the containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set up container resource limits to prevent resource exhaustion:&lt;/p&gt;&lt;p&gt;Edit your docker-compose.yml file again:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add resource limits to both services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;services:
  ghost:
    # Existing configuration...
    deploy:
      resources:
        limits:
          memory: 1G
        reservations:
          memory: 512M
  
  db:
    # Existing configuration...
    deploy:
      resources:
        limits:
          memory: 1G
        reservations:
          memory: 256M
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This prevents containers from consuming excessive resources, which could lead to system instability. Save the file and restart the containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose down
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regularly update your Ghost installation to receive security patches and new features:&lt;/p&gt;&lt;p&gt;Check for new Ghost versions:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker pull ghost:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls the latest Ghost image. The output will indicate if a newer version is available.&lt;/p&gt;&lt;p&gt;Create a backup before updating:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./backup-ghost.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a backup of your content and database before updating.&lt;/p&gt;&lt;p&gt;Update Ghost and other containers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose pull
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls the latest versions of all images in your docker-compose.yml file and recreates the containers.&lt;/p&gt;&lt;p&gt;Monitor container logs for any issues after updating:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs -f
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows real-time logs from all containers. Press Ctrl+C to exit the log view.&lt;/p&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;ghost-container-wont-start&quot;&gt;Ghost Container Won&amp;#39;t Start&lt;a class=&quot;h-anchor&quot; href=&quot;#ghost-container-wont-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check the container logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs ghost
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Look for error messages that might indicate the problem. Common issues include:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Database connection problems: Verify MySQL is running and credentials are correct&lt;/li&gt;&lt;li&gt;Port conflicts: Make sure nothing else is using port 2368&lt;/li&gt;&lt;li&gt;File permission issues: Run &lt;code&gt;sudo chown -R 1000:1000 ghost-content&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;database-container-wont-start&quot;&gt;Database Container Won&amp;#39;t Start&lt;a class=&quot;h-anchor&quot; href=&quot;#database-container-wont-start&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check the database container logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs db
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Common MySQL issues include:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Data directory permission problems: Run &lt;code&gt;sudo chown -R 999:999 mysql-data&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Corrupted data files: Restore from a backup or initialize with a fresh database&lt;/li&gt;&lt;li&gt;Insufficient system resources: Check your system&amp;#39;s available memory and disk space&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;nginx-shows-502-bad-gateway&quot;&gt;Nginx Shows 502 Bad Gateway&lt;a class=&quot;h-anchor&quot; href=&quot;#nginx-shows-502-bad-gateway&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This usually means Nginx can&amp;#39;t connect to Ghost. Verify Ghost is running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Check if Ghost is accessible locally:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl http://localhost:2368
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This tests if Ghost is responding on its default port. If this works but Nginx shows 502, check your Nginx configuration.&lt;/p&gt;&lt;h3 id=&quot;email-delivery-problems&quot;&gt;Email Delivery Problems&lt;a class=&quot;h-anchor&quot; href=&quot;#email-delivery-problems&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Test email configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose exec ghost curl -X POST &amp;quot;http://localhost:2368/ghost/api/admin/mail/test/&amp;quot; \
  -H &amp;quot;Origin: http://localhost:2368&amp;quot; \
  -H &amp;quot;Content-Type: application/json&amp;quot; \
  -d &amp;#39;{&amp;quot;mail&amp;quot;:{&amp;quot;to&amp;quot;:&amp;quot;your-email@example.com&amp;quot;}}&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-email@example.com&lt;/code&gt; with your actual email address. Check Ghost logs for SMTP errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose logs ghost | grep -i mail
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This searches logs for mail-related entries. Verify your SMTP credentials and server settings.&lt;/p&gt;&lt;h3 id=&quot;ssl-certificate-issues&quot;&gt;SSL Certificate Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#ssl-certificate-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If your SSL certificate isn&amp;#39;t working, check the certificate files:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ls -la /etc/letsencrypt/live/yourdomain.com/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Test certificate renewal:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo certbot renew --dry-run
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Nginx is using the correct certificate paths in your configuration file.&lt;/p&gt;&lt;h2 id=&quot;known-limitations-and-workarounds&quot;&gt;Known Limitations and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-limitations-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;memory-usage&quot;&gt;Memory Usage&lt;a class=&quot;h-anchor&quot; href=&quot;#memory-usage&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Ghost can consume significant memory, especially with many images or a large database. If you experience performance issues:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Increase the container memory limit in docker-compose.yml&lt;/li&gt;&lt;li&gt;Consider using a swapfile for additional virtual memory:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To make the swap permanent, add it to fstab:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;#39;/swapfile none swap sw 0 0&amp;#39; | sudo tee -a /etc/fstab
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;upload-limits&quot;&gt;Upload Limits&lt;a class=&quot;h-anchor&quot; href=&quot;#upload-limits&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you can&amp;#39;t upload large files to Ghost, check your Nginx client_max_body_size setting:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/nginx/sites-available/yourdomain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Increase the value if needed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;client_max_body_size 100M;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and restart Nginx:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nginx -t
sudo systemctl restart nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully functional Ghost CMS installation running on Docker with proper security measures in place. Regular maintenance, backups, and security updates will ensure your Ghost blog remains reliable and secure. By following this guide, you&amp;#39;ve created a robust publishing platform that&amp;#39;s easy to manage and scale as your needs grow.&lt;/p&gt;&lt;p&gt;Remember to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Regularly update Ghost and other components&lt;/li&gt;&lt;li&gt;Monitor system resource usage&lt;/li&gt;&lt;li&gt;Maintain regular backups&lt;/li&gt;&lt;li&gt;Check for security advisories related to Ghost, Docker, and Ubuntu&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;With proper maintenance, your Ghost blog will provide a stable and secure platform for your content for years to come.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing and Self-Hosting Bitwarden on Ubuntu 20.04+ with Docker</title><link>https://diylabhub.com/complete-guide-to-installing-and-self-hosting-bitwarden-on-ubuntu-20-04-with-docker/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-self-hosting-bitwarden-on-ubuntu-20-04-with-docker/</guid><pubDate>Sun, 09 Mar 2025 06:22:22 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Self-hosting your password manager gives you complete control over your sensitive credentials. This comprehensive guide walks you through setting up Bitwarden on Ubuntu using Docker, with security best practices, troubleshooting tips, and maintenance procedures to ensure a robust deployment.&lt;/p&gt;&lt;h2 id=&quot;introduction-why-self-host-bitwarden&quot;&gt;Introduction: Why Self-Host Bitwarden?&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-why-self-host-bitwarden&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Bitwarden is an open-source password manager that securely stores your sensitive information in an encrypted vault. Self-hosting Bitwarden provides several key advantages:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Complete control over your password data&lt;/li&gt;&lt;li&gt;No reliance on third-party servers for storing sensitive information&lt;/li&gt;&lt;li&gt;Enhanced privacy since you manage where your data resides&lt;/li&gt;&lt;li&gt;Customizable configuration based on your specific needs&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Using Docker for deployment simplifies the installation and maintenance processes by containerizing the application and its dependencies, making the entire setup more portable and easier to manage.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;instruction layout&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/wp-content/uploads/2025/03/BitWorden_InstructionLayout-1-87x1024.png&quot; alt/&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;hr/&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning the installation, ensure your system meets the following requirements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 LTS or newer (this guide works for Ubuntu 22.04 as well)&lt;/li&gt;&lt;li&gt;A server with at least 2GB of RAM&lt;/li&gt;&lt;li&gt;Minimum 10GB free disk space&lt;/li&gt;&lt;li&gt;Internet connection for downloading packages&lt;/li&gt;&lt;li&gt;Root or sudo privileges&lt;/li&gt;&lt;li&gt;A domain name pointing to your server (for secure access)&lt;/li&gt;&lt;li&gt;Open ports 80 and 443 on your firewall&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;system-preparation&quot;&gt;System Preparation&lt;a class=&quot;h-anchor&quot; href=&quot;#system-preparation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;First, update your system to ensure you have the latest packages:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This step minimizes compatibility issues and security vulnerabilities by bringing your system up to date.&lt;/p&gt;&lt;p&gt;Next, install the necessary dependencies for Docker installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages enable secure APT repositories, certificate verification, and other requirements for Docker.&lt;/p&gt;&lt;p&gt;If any package fails to install, you might see error messages. In that case, try running the update command again to fix any potential repository issues.&lt;/p&gt;&lt;h2 id=&quot;creating-a-dedicated-bitwarden-user&quot;&gt;Creating a Dedicated Bitwarden User&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-a-dedicated-bitwarden-user&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For security reasons, it&amp;#39;s best to create a dedicated user for running Bitwarden. This isolates the Bitwarden installation from other applications and follows the principle of least privilege.&lt;/p&gt;&lt;p&gt;Create a directory for Bitwarden:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir -p /opt/bitwarden
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a dedicated user named &amp;#39;bitwarden&amp;#39; with the home directory at /opt/bitwarden:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo useradd -s /bin/bash -d /opt/bitwarden bitwarden
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set proper directory permissions:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chmod -R 700 /opt/bitwarden
sudo chown -R bitwarden:bitwarden /opt/bitwarden
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These permissions ensure that only the bitwarden user can access the installation directory.&lt;/p&gt;&lt;h2 id=&quot;installing-docker-and-docker-compose&quot;&gt;Installing Docker and Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-docker-and-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker is required to run Bitwarden containers. Let&amp;#39;s add the official Docker repository and install Docker.&lt;/p&gt;&lt;p&gt;Add Docker&amp;#39;s official GPG key:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the Docker repository:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Update package information:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Install Docker:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install docker-ce docker-ce-cli containerd.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify Docker installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see &amp;quot;active (running)&amp;quot; in the output. If Docker isn&amp;#39;t running, start it with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl start docker &amp;amp;&amp;amp; sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command both starts Docker and ensures it launches automatically on system boot.&lt;/p&gt;&lt;p&gt;Allow the bitwarden user to run Docker commands:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker bitwarden
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Adding the bitwarden user to the docker group allows it to execute Docker commands without sudo.&lt;/p&gt;&lt;h2 id=&quot;installing-bitwarden&quot;&gt;Installing Bitwarden&lt;a class=&quot;h-anchor&quot; href=&quot;#installing-bitwarden&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now we&amp;#39;re ready to install Bitwarden. Switch to the bitwarden user and navigate to its home directory:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo su - bitwarden
cd /opt/bitwarden
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Download the official Bitwarden installation script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x bitwarden.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Before running the installation, you need to obtain a Bitwarden installation ID and key from Bitwarden&amp;#39;s website. Visit https://bitwarden.com/host/ and complete the form to receive your installation ID and key by email.&lt;/p&gt;&lt;p&gt;Run the installation script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh install
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The installation wizard will prompt you for several pieces of information:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Your domain name (e.g., bitwarden.yourdomain.com)&lt;/li&gt;&lt;li&gt;Whether to use Let&amp;#39;s Encrypt for SSL (recommended for production)&lt;/li&gt;&lt;li&gt;Your email address (for Let&amp;#39;s Encrypt certificates)&lt;/li&gt;&lt;li&gt;Your installation ID&lt;/li&gt;&lt;li&gt;Your installation key&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;If any prompt fails to appear or the installation stops unexpectedly, check for error messages in the terminal output. Common issues include network connectivity problems or insufficient disk space.&lt;/p&gt;&lt;h2 id=&quot;starting-bitwarden-server&quot;&gt;Starting Bitwarden Server&lt;a class=&quot;h-anchor&quot; href=&quot;#starting-bitwarden-server&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After installation completes, start the Bitwarden server:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh start
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify all containers are running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see multiple Bitwarden containers running. If any container is missing or shows a status other than &amp;quot;Up&amp;quot;, check the logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs bitwarden-mssql
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;quot;bitwarden-mssql&amp;quot; with the name of the problematic container.&lt;/p&gt;&lt;h2 id=&quot;configuring-smtp-for-email&quot;&gt;Configuring SMTP for Email&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-smtp-for-email&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Email functionality is important for account recovery and notifications. Edit the global environment file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano /opt/bitwarden/bwdata/env/global.override.env
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Configure the email settings by adding or modifying these lines:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;globalSettings__mail__replyToEmail=your_email@domain.com
globalSettings__mail__smtp__host=smtp.your-provider.com
globalSettings__mail__smtp__port=587
globalSettings__mail__smtp__ssl=true
globalSettings__mail__smtp__username=your_email@domain.com
globalSettings__mail__smtp__password=your_password
globalSettings__mail__smtp__useDefaultCredentials=false
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After modifying the configuration, restart Bitwarden:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh restart
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If email sending fails, check your SMTP settings and ensure your email provider allows SMTP access from your server&amp;#39;s IP address.&lt;/p&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Securing your Bitwarden instance is crucial since it contains sensitive information. Here are essential security measures:&lt;/p&gt;&lt;h3 id=&quot;restrict-admin-access&quot;&gt;Restrict Admin Access&lt;a class=&quot;h-anchor&quot; href=&quot;#restrict-admin-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Edit the global environment file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano /opt/bitwarden/bwdata/env/global.override.env
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following line to disable new user registrations (recommended for personal or small team use):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;globalSettings__disableUserRegistration=true
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart Bitwarden to apply changes:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh restart
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;set-up-proper-firewall-rules&quot;&gt;Set Up Proper Firewall Rules&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-proper-firewall-rules&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install and configure UFW (Uncomplicated Firewall):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install ufw -y
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify the firewall status:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If your SSH port is not the default (22), replace &amp;quot;ssh&amp;quot; with your specific port.&lt;/p&gt;&lt;h3 id=&quot;regular-updates&quot;&gt;Regular Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#regular-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Keep your Bitwarden installation updated:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh updateself
./bitwarden.sh update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands update both the installation script itself and the Bitwarden application.&lt;/p&gt;&lt;h2 id=&quot;backup-and-restoration&quot;&gt;Backup and Restoration&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-and-restoration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular backups are essential for data safety. Bitwarden automatically takes nightly backups of the database, but a comprehensive backup strategy includes more elements.&lt;/p&gt;&lt;h3 id=&quot;setting-up-manual-backups&quot;&gt;Setting Up Manual Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-manual-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano /opt/bitwarden/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
# Create timestamp
TIMESTAMP=$(date +&amp;quot;%Y%m%d_%H%M%S&amp;quot;)
BACKUP_DIR=&amp;quot;/opt/bitwarden/backups/$TIMESTAMP&amp;quot;

# Create backup directory
mkdir -p $BACKUP_DIR

# Stop Bitwarden to ensure data consistency
/opt/bitwarden/bitwarden.sh stop

# Backup important directories
cp -r /opt/bitwarden/bwdata/env $BACKUP_DIR/
cp -r /opt/bitwarden/bwdata/core/attachments $BACKUP_DIR/
cp -r /opt/bitwarden/bwdata/mssql/data $BACKUP_DIR/
cp -r /opt/bitwarden/bwdata/core/aspnet-dataprotection $BACKUP_DIR/
cp -r /opt/bitwarden/bwdata/ssl $BACKUP_DIR/

# Restart Bitwarden
/opt/bitwarden/bitwarden.sh start

# Compress backup
tar -czf /opt/bitwarden/backups/bitwarden_backup_$TIMESTAMP.tar.gz -C /opt/bitwarden/backups $TIMESTAMP

# Remove uncompressed backup directory
rm -rf $BACKUP_DIR

echo &amp;quot;Backup completed: /opt/bitwarden/backups/bitwarden_backup_$TIMESTAMP.tar.gz&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x /opt/bitwarden/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a backup directory:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p /opt/bitwarden/backups
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To run a manual backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;/opt/bitwarden/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For automated backups, set up a cron job. Open the crontab:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;crontab -e
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add this line to run the backup weekly at 2 AM on Sunday:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;0 2 * * 0 /opt/bitwarden/backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;restoring-from-backup&quot;&gt;Restoring from Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#restoring-from-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To restore from backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Extract backup
tar -xzf /opt/bitwarden/backups/bitwarden_backup_TIMESTAMP.tar.gz -C /opt/bitwarden/backups/

# Stop Bitwarden
/opt/bitwarden/bitwarden.sh stop

# Restore directories
cp -r /opt/bitwarden/backups/TIMESTAMP/env /opt/bitwarden/bwdata/
cp -r /opt/bitwarden/backups/TIMESTAMP/attachments /opt/bitwarden/bwdata/core/
cp -r /opt/bitwarden/backups/TIMESTAMP/data /opt/bitwarden/bwdata/mssql/
cp -r /opt/bitwarden/backups/TIMESTAMP/aspnet-dataprotection /opt/bitwarden/bwdata/core/
cp -r /opt/bitwarden/backups/TIMESTAMP/ssl /opt/bitwarden/bwdata/

# Fix permissions
chown -R bitwarden:bitwarden /opt/bitwarden/bwdata

# Start Bitwarden
/opt/bitwarden/bitwarden.sh start
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;quot;TIMESTAMP&amp;quot; with your actual backup timestamp.&lt;/p&gt;&lt;h2 id=&quot;common-problems-and-solutions&quot;&gt;Common Problems and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-problems-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Here are some common issues users encounter and their solutions:&lt;/p&gt;&lt;h3 id=&quot;container-startup-failures&quot;&gt;Container Startup Failures&lt;a class=&quot;h-anchor&quot; href=&quot;#container-startup-failures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If containers fail to start:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check container status
docker ps -a

# View logs of specific container
docker logs bitwarden-mssql
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution: If the error relates to permissions, ensure proper ownership:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R bitwarden:bitwarden /opt/bitwarden/bwdata
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;database-connection-issues&quot;&gt;Database Connection Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#database-connection-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you experience database connectivity problems:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check database container is running
docker ps | grep mssql

# View database logs
docker logs bitwarden-mssql
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution: You may need to recreate the database container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh rebuild mssql
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;ssl-certificate-problems&quot;&gt;SSL Certificate Problems&lt;a class=&quot;h-anchor&quot; href=&quot;#ssl-certificate-problems&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If SSL certificates aren&amp;#39;t working properly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check certificate status
ls -la /opt/bitwarden/bwdata/ssl
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution: Reinstall certificates:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh updateself
./bitwarden.sh update
./bitwarden.sh rebuild nginx
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;email-configuration-issues&quot;&gt;Email Configuration Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#email-configuration-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If email notifications aren&amp;#39;t working:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check mail settings
grep -A 10 &amp;quot;mail&amp;quot; /opt/bitwarden/bwdata/env/global.override.env
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution: Verify your SMTP settings and test with a simple telnet command:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;telnet your-smtp-server 587
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If telnet isn&amp;#39;t installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install telnet -y
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;read-only-file-system-error&quot;&gt;&amp;quot;Read-only File System&amp;quot; Error&lt;a class=&quot;h-anchor&quot; href=&quot;#read-only-file-system-error&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some users encounter &amp;quot;mkdir /bw-data: read-only file system&amp;quot; errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check filesystem status
df -h

# Check for errors
dmesg | grep -i error
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Solution: This often indicates filesystem corruption. Try remounting the filesystem:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mount -o remount,rw /
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If the issue persists, consider changing the data path in your Docker configuration.&lt;/p&gt;&lt;h2 id=&quot;maintenance-tasks&quot;&gt;Maintenance Tasks&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-tasks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regular maintenance ensures your Bitwarden instance remains secure and performs optimally.&lt;/p&gt;&lt;h3 id=&quot;updating-bitwarden&quot;&gt;Updating Bitwarden&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-bitwarden&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Update the Bitwarden installation script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;./bitwarden.sh updateself
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Update Bitwarden:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;./bitwarden.sh update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Rebuild and restart:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;./bitwarden.sh rebuild
./bitwarden.sh restart
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring-disk-space&quot;&gt;Monitoring Disk Space&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-disk-space&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Monitor disk space regularly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;df -h
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If space is running low, clean Docker:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;docker system prune -a --volumes
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command removes unused containers, networks, images, and volumes. Be careful, as it can delete useful data.&lt;/p&gt;&lt;h3 id=&quot;log-rotation&quot;&gt;Log Rotation&lt;a class=&quot;h-anchor&quot; href=&quot;#log-rotation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set up log rotation to prevent logs from consuming excessive disk space:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/logrotate.d/bitwarden
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;/opt/bitwarden/bwdata/logs/*.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    create 0640 bitwarden bitwarden
}
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;known-issues-and-workarounds&quot;&gt;Known Issues and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-issues-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;memory-usage-with-mssql&quot;&gt;Memory Usage with MSSQL&lt;a class=&quot;h-anchor&quot; href=&quot;#memory-usage-with-mssql&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The MSSQL container can use significant memory, which might be problematic on smaller servers.&lt;/p&gt;&lt;p&gt;Workaround: Adjust MSSQL memory settings:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano /opt/bitwarden/bwdata/env/mssql.override.env
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;MSSQL_MEMORY_LIMIT_MB=1024
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh restart
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;web-vault-connectivity-issues&quot;&gt;Web Vault Connectivity Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#web-vault-connectivity-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Users sometimes encounter &amp;quot;Error fetching network&amp;quot; messages when accessing the web vault.&lt;/p&gt;&lt;p&gt;Workaround: Clear browser cache or try a different browser. If that doesn&amp;#39;t help, rebuild the web container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;./bitwarden.sh rebuild web
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;database-corruption&quot;&gt;Database Corruption&lt;a class=&quot;h-anchor&quot; href=&quot;#database-corruption&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In rare cases, the database may become corrupted.&lt;/p&gt;&lt;p&gt;Workaround: Restore from the latest automatic backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Stop Bitwarden
./bitwarden.sh stop

# Find the latest backup
ls -la /opt/bitwarden/bwdata/mssql/backups

# Restore database (replace DATE with actual date)
cp /opt/bitwarden/bwdata/mssql/backups/vault_DATE.bak /opt/bitwarden/bwdata/mssql/data/

# Start Bitwarden
./bitwarden.sh start
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a secured and properly configured Bitwarden installation on your Ubuntu server. This setup provides a robust, self-hosted password management solution that gives you complete control over your sensitive data. Regular maintenance and backups will ensure your installation remains secure and reliable.&lt;/p&gt;&lt;p&gt;Remember that while self-hosting provides increased privacy and control, it also means you&amp;#39;re responsible for security, backups, and maintenance. Following the steps in this guide will help you manage these responsibilities effectively.&lt;/p&gt;&lt;p&gt;For additional support, visit the official Bitwarden community forums or GitHub repository, where many users share their experiences and solutions to common problems.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>The Ultimate Guide to Installing and Securing Home Assistant on Ubuntu 20.04+</title><link>https://diylabhub.com/the-ultimate-guide-to-installing-and-securing-home-assistant-on-ubuntu-20-04/</link><guid isPermaLink="true">https://diylabhub.com/the-ultimate-guide-to-installing-and-securing-home-assistant-on-ubuntu-20-04/</guid><pubDate>Sun, 09 Mar 2025 05:49:06 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Home Assistant is a powerful open-source home automation platform that puts local control and privacy first. It allows you to integrate and control all your smart devices from a single dashboard, creating automations that make your home truly smart. This comprehensive guide will walk you through installing Home Assistant on Ubuntu 20.04 and newer versions using multiple methods, ensuring you select the one that best fits your needs and technical comfort level.&lt;/p&gt;&lt;h2 id=&quot;introduction-understanding-your-installation-options&quot;&gt;Introduction: Understanding Your Installation Options&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-understanding-your-installation-options&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before diving into installation procedures, it&amp;#39;s crucial to understand that Home Assistant offers several installation methods, each with different features and complexity levels. We&amp;#39;ll cover Docker installation (most flexible), VM installation (most isolated), and direct OS installation (most integrated).&lt;/p&gt;&lt;p&gt;Home Assistant comes in several flavors, each with its own benefits and trade-offs:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Home Assistant OS&lt;/strong&gt;: A complete, managed operating system designed specifically for Home Assistant. This is the recommended method for dedicated devices.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Home Assistant Container&lt;/strong&gt;: Running Home Assistant in a Docker container. Great for users who want to run Home Assistant alongside other services on the same machine.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Home Assistant Supervised&lt;/strong&gt;: A middle ground that allows you to install the Supervisor component on top of a regular operating system.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Home Assistant Core&lt;/strong&gt;: The most minimal installation, without the Supervisor and add-ons.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This table compares key features across installation methods:&lt;/p&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Feature&lt;/th&gt;&lt;th&gt;Home Assistant OS&lt;/th&gt;&lt;th&gt;Home Assistant Container&lt;/th&gt;&lt;th&gt;Home Assistant Core&lt;/th&gt;&lt;th&gt;Home Assistant Supervised&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Automations&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dashboards&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Integrations&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Add-ons&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✗&lt;/td&gt;&lt;td&gt;✗&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Backups&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✗&lt;/td&gt;&lt;td&gt;✗&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;One-click updates&lt;/td&gt;&lt;td&gt;✓&lt;/td&gt;&lt;td&gt;✗&lt;/td&gt;&lt;td&gt;✗&lt;/td&gt;&lt;td&gt;✓*&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;*Home Assistant Supervised requires users to maintain their own operating system.&lt;/p&gt;&lt;h2 id=&quot;method-1-installing-home-assistant-using-docker-recommended&quot;&gt;Method 1: Installing Home Assistant Using Docker (Recommended)&lt;a class=&quot;h-anchor&quot; href=&quot;#method-1-installing-home-assistant-using-docker-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Docker provides an excellent balance of flexibility and isolation, making it ideal for running Home Assistant on an existing Ubuntu system. This method is perfect if you&amp;#39;re already running other services on your machine and want to keep Home Assistant contained.&lt;/p&gt;&lt;h3 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 or newer installed and updated&lt;/li&gt;&lt;li&gt;A user with sudo privileges&lt;/li&gt;&lt;li&gt;Minimum hardware: 2GB RAM, dual-core CPU, 32GB storage&lt;/li&gt;&lt;li&gt;Network: Port 8123 (Home Assistant web interface) should be accessible&lt;/li&gt;&lt;li&gt;Basic familiarity with terminal commands&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;step-1-update-your-ubuntu-system&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Your Ubuntu System&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-your-ubuntu-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, ensure your system is fully updated to prevent any dependency issues:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates your package list and upgrades all installed packages to their latest versions. If the update fails, check your internet connection or try changing your APT mirror.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-required-dependencies&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Required Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-required-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install the necessary packages for Docker installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages enable secure APT connections and provide tools needed for the Docker repository. If you encounter any &amp;quot;package not found&amp;quot; errors, your APT sources may be incomplete.&lt;/p&gt;&lt;h3 id=&quot;step-3-add-dockers-official-gpg-key&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Docker&amp;#39;s Official GPG Key&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-add-dockers-official-gpg-key&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add Docker&amp;#39;s official GPG key to ensure package authenticity:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command downloads Docker&amp;#39;s GPG key and adds it to your system. If it fails, check your internet connection or try again later.&lt;/p&gt;&lt;h3 id=&quot;step-4-set-up-the-docker-repository&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up the Docker Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-set-up-the-docker-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add the Docker repository to your APT sources:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command adds the appropriate Docker repository for your Ubuntu version. If you see an error about an unsupported distribution, you may need to manually specify a supported Ubuntu codename.&lt;/p&gt;&lt;h3 id=&quot;step-5-install-docker-engine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Update the package index and install Docker:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the Docker Engine, CLI, containerd runtime, and Docker Compose plugin. If the installation fails, check the Docker compatibility with your specific Ubuntu version.&lt;/p&gt;&lt;h3 id=&quot;step-6-add-your-user-to-the-docker-group&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Your User to the Docker Group&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-add-your-user-to-the-docker-group&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add your user to the Docker group to run Docker commands without sudo:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command adds your current user to the Docker group. For the changes to take effect, you&amp;#39;ll need to log out and log back in, or run &lt;code&gt;newgrp docker&lt;/code&gt; to update your current session.&lt;/p&gt;&lt;h3 id=&quot;step-7-create-a-directory-for-home-assistant-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Directory for Home Assistant Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-create-a-directory-for-home-assistant-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a directory to store your Home Assistant configuration files:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/homeassistant/config
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory structure for Home Assistant&amp;#39;s persistent data. If the command fails, check that you have write permissions to your home directory.&lt;/p&gt;&lt;h3 id=&quot;step-8-run-home-assistant-container&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Run Home Assistant Container&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-run-home-assistant-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now, run the Home Assistant container with the configuration volume mounted:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -d \
  --name=homeassistant \
  --restart=unless-stopped \
  --network=host \
  -v ~/homeassistant/config:/config \
  -v /etc/localtime:/etc/localtime:ro \
  --privileged \
  ghcr.io/home-assistant/home-assistant:stable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command starts Home Assistant in a Docker container with access to your network and mounts the configuration directory. The &lt;code&gt;--privileged&lt;/code&gt; flag is needed for certain integrations, though it has security implications. If the container doesn&amp;#39;t start, check the Docker logs with &lt;code&gt;docker logs homeassistant&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;step-9-verify-home-assistant-is-running&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Home Assistant is Running&lt;a class=&quot;h-anchor&quot; href=&quot;#step-9-verify-home-assistant-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check that Home Assistant started successfully:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker ps | grep homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see the running container in the output. If not, check the logs for errors: &lt;code&gt;docker logs homeassistant&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;step-10-access-home-assistant-web-interface&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 10&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access Home Assistant Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#step-10-access-home-assistant-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open a web browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://YOUR_SERVER_IP:8123
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;YOUR_SERVER_IP&lt;/code&gt; with your server&amp;#39;s IP address. The initial setup will take a few minutes as Home Assistant downloads and initializes components. If you can&amp;#39;t access the web interface, ensure port 8123 isn&amp;#39;t blocked by a firewall.&lt;/p&gt;&lt;h2 id=&quot;method-2-installing-home-assistant-os-in-a-virtual-machine&quot;&gt;Method 2: Installing Home Assistant OS in a Virtual Machine&lt;a class=&quot;h-anchor&quot; href=&quot;#method-2-installing-home-assistant-os-in-a-virtual-machine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you prefer a more isolated installation or want the complete Home Assistant experience with add-ons, installing Home Assistant OS in a virtual machine is an excellent option.&lt;/p&gt;&lt;h3 id=&quot;prerequisites-1&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites-1&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 or newer as host OS&lt;/li&gt;&lt;li&gt;At least 4GB of free RAM and 2 CPU cores&lt;/li&gt;&lt;li&gt;32GB of free disk space&lt;/li&gt;&lt;li&gt;Virtualization enabled in BIOS/UEFI&lt;/li&gt;&lt;li&gt;Administrator privileges&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;step-1-install-kvm-and-required-packages&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install KVM and Required Packages&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-kvm-and-required-packages&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install KVM and related packages for virtualization:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager ovmf
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages provide the necessary components for KVM virtualization. If the installation fails, ensure your CPU supports virtualization and that it&amp;#39;s enabled in your BIOS/UEFI settings.&lt;/p&gt;&lt;h3 id=&quot;step-2-add-your-user-to-virtualization-groups&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Add Your User to Virtualization Groups&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-add-your-user-to-virtualization-groups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add your user to the libvirt and kvm groups:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo adduser $USER libvirt
sudo adduser $USER kvm
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This grants your user permission to manage virtual machines. Log out and back in for these changes to take effect.&lt;/p&gt;&lt;h3 id=&quot;step-3-verify-libvirt-is-running&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Verify Libvirt is Running&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-verify-libvirt-is-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check that the libvirt daemon is running:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status libvirtd
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If it&amp;#39;s not running, start and enable it:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl enable --now libvirtd
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-download-home-assistant-os-image&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Download Home Assistant OS Image&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-download-home-assistant-os-image&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a directory for the VM image and download the latest Home Assistant OS:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/hassos-vm &amp;amp;&amp;amp; cd ~/hassos-vm
wget https://github.com/home-assistant/operating-system/releases/download/10.0/haos_ova-10.0.qcow2.xz
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads the latest QCOW2 image for Home Assistant OS. If the link is outdated, visit the Home Assistant GitHub releases page for the current version.&lt;/p&gt;&lt;h3 id=&quot;step-5-extract-the-image&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Extract the Image&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-extract-the-image&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Extract the downloaded image:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;unxz haos_ova-10.0.qcow2.xz
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This extracts the compressed QCOW2 image. If the command fails, ensure you have the &lt;code&gt;xz-utils&lt;/code&gt; package installed.&lt;/p&gt;&lt;h3 id=&quot;step-6-create-a-virtual-machine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Virtual Machine&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-create-a-virtual-machine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a virtual machine using the extracted image:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo virt-install \
  --name homeassistant \
  --memory 4096 \
  --vcpus 2 \
  --import \
  --disk ~/hassos-vm/haos_ova-10.0.qcow2,format=qcow2 \
  --os-variant generic \
  --network bridge=virbr0 \
  --graphics none \
  --boot uefi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a VM with 4GB RAM and 2 vCPUs. If you encounter errors about missing firmware, ensure the &lt;code&gt;ovmf&lt;/code&gt; package is properly installed. Adjust the memory and CPU values based on your system capabilities.&lt;/p&gt;&lt;h3 id=&quot;step-7-find-your-vms-ip-address&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Find Your VM&amp;#39;s IP Address&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-find-your-vms-ip-address&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;List your virtual machines and find their IP addresses:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo virsh list
sudo virsh domifaddr homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Note the IP address from the output. If no IP address is displayed, wait a few minutes for the VM to fully boot and obtain an IP address.&lt;/p&gt;&lt;h3 id=&quot;step-8-access-home-assistant&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access Home Assistant&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-access-home-assistant&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open a web browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://VM_IP_ADDRESS:8123
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;VM_IP_ADDRESS&lt;/code&gt; with the IP address obtained in the previous step. The initial setup will take a few minutes. If you can&amp;#39;t access the web interface, ensure the VM is running and has network connectivity.&lt;/p&gt;&lt;h3 id=&quot;step-9-enable-automatic-start-for-the-vm&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enable Automatic Start for the VM&lt;a class=&quot;h-anchor&quot; href=&quot;#step-9-enable-automatic-start-for-the-vm&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Configure the VM to start automatically when your system boots:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo virsh autostart homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures Home Assistant will be available after system reboots. If the command fails, check that the VM exists and that you have sufficient privileges.&lt;/p&gt;&lt;h2 id=&quot;method-3-installing-home-assistant-core-on-ubuntu&quot;&gt;Method 3: Installing Home Assistant Core on Ubuntu&lt;a class=&quot;h-anchor&quot; href=&quot;#method-3-installing-home-assistant-core-on-ubuntu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For users who want to run Home Assistant directly on their Ubuntu system without containerization or virtualization, Home Assistant Core is a viable option, though it lacks the add-on system available in other methods.&lt;/p&gt;&lt;h3 id=&quot;prerequisites-2&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites-2&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 20.04 or newer&lt;/li&gt;&lt;li&gt;Python 3.11 or newer&lt;/li&gt;&lt;li&gt;2GB RAM minimum (4GB recommended)&lt;/li&gt;&lt;li&gt;32GB storage space&lt;/li&gt;&lt;li&gt;Administrator privileges&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;step-1-install-required-dependencies&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Required Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-required-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install the necessary packages for Home Assistant Core:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install -y python3-pip python3-dev python3-venv libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These packages provide essential libraries for Home Assistant. If any package installation fails, try running &lt;code&gt;sudo apt update&lt;/code&gt; again or check for specific package name changes in your Ubuntu version.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-python-311&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Python 3.11&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-python-311&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add the deadsnakes PPA and install Python 3.11:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install -y python3.11 python3.11-dev python3.11-venv
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs Python 3.11 and related development packages. If you&amp;#39;re using Ubuntu 22.04 or newer, Python 3.10+ might already be installed, but 3.11 is recommended for best compatibility with Home Assistant.&lt;/p&gt;&lt;h3 id=&quot;step-3-create-a-home-assistant-user&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Home Assistant User&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-a-home-assistant-user&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a dedicated user for running Home Assistant:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo useradd -rm homeassistant
sudo usermod -aG dialout homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a system user and adds it to the dialout group for serial device access. If the user already exists, you can skip this step.&lt;/p&gt;&lt;h3 id=&quot;step-4-create-the-home-assistant-directory&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create the Home Assistant Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-create-the-home-assistant-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a directory for Home Assistant and set the proper ownership:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir -p /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates the directory where Home Assistant will be installed and gives ownership to the homeassistant user. If the directory already exists, adjust the commands accordingly.&lt;/p&gt;&lt;h3 id=&quot;step-5-create-and-activate-virtual-environment&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create and Activate Virtual Environment&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-create-and-activate-virtual-environment&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Switch to the homeassistant user and create a Python virtual environment:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.11 -m venv .
source bin/activate
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates an isolated Python environment for Home Assistant. If you encounter an error about Python 3.11 not being found, ensure it was installed correctly in step 2.&lt;/p&gt;&lt;h3 id=&quot;step-6-install-home-assistant-core&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Home Assistant Core&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-install-home-assistant-core&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;With the virtual environment activated, install Home Assistant:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pip3 install wheel
pip3 install homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the wheel package (required for some dependencies) and then Home Assistant itself. The installation may take several minutes. If you encounter errors about missing C compilers, ensure the build-essential package is installed.&lt;/p&gt;&lt;h3 id=&quot;step-7-start-home-assistant-for-the-first-time&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Start Home Assistant for the First Time&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-start-home-assistant-for-the-first-time&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Launch Home Assistant to complete the initial setup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;hass
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts Home Assistant and initializes the configuration directory. Wait until you see &amp;quot;Home Assistant is now available at http://localhost:8123&amp;quot; in the console output. The first startup may take 5-10 minutes as dependencies are downloaded and compiled.&lt;/p&gt;&lt;p&gt;Press Ctrl+C to stop Home Assistant after the initial setup is complete.&lt;/p&gt;&lt;h3 id=&quot;step-8-create-a-systemd-service&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Systemd Service&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-create-a-systemd-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Exit the homeassistant user shell:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;exit
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a systemd service file for Home Assistant:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/systemd/system/home-assistant@homeassistant.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content to the file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
WorkingDirectory=/srv/homeassistant
ExecStart=/srv/homeassistant/bin/hass -c &amp;quot;/srv/homeassistant/.homeassistant&amp;quot;
Restart=on-failure
RestartForceExitStatus=100

[Install]
WantedBy=multi-user.target
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a systemd service to manage Home Assistant. If you&amp;#39;ve installed Home Assistant in a different location, adjust the paths accordingly.&lt;/p&gt;&lt;h3 id=&quot;step-9-enable-and-start-the-home-assistant-service&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enable and Start the Home Assistant Service&lt;a class=&quot;h-anchor&quot; href=&quot;#step-9-enable-and-start-the-home-assistant-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Enable the service to start on boot and start it immediately:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl enable home-assistant@homeassistant.service
sudo systemctl start home-assistant@homeassistant.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This enables and starts the Home Assistant service. Check its status with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status home-assistant@homeassistant.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If the service fails to start, check the logs for errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo journalctl -fu home-assistant@homeassistant.service
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-10-access-home-assistant&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 10&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access Home Assistant&lt;a class=&quot;h-anchor&quot; href=&quot;#step-10-access-home-assistant&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open a web browser and navigate to:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;open&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;circle cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;9&quot;/&gt;&lt;path d=&quot;M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18&quot;/&gt;&lt;/svg&gt;Open in your browser&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy address&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy address&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;http://YOUR_SERVER_IP:8123
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;YOUR_SERVER_IP&lt;/code&gt; with your server&amp;#39;s IP address. Complete the initial setup by creating an admin account. If you can&amp;#39;t access the web interface, check that port 8123 isn&amp;#39;t blocked by a firewall.&lt;/p&gt;&lt;h2 id=&quot;securing-your-home-assistant-installation&quot;&gt;Securing Your Home Assistant Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#securing-your-home-assistant-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Regardless of which installation method you choose, securing your Home Assistant instance is crucial, especially if you plan to access it remotely.&lt;/p&gt;&lt;h3 id=&quot;set-up-https-with-lets-encrypt&quot;&gt;Set Up HTTPS with Let&amp;#39;s Encrypt&lt;a class=&quot;h-anchor&quot; href=&quot;#set-up-https-with-lets-encrypt&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you&amp;#39;re using Docker, you can add a reverse proxy like Nginx Proxy Manager or Traefik alongside Home Assistant:&lt;/p&gt;&lt;h4 id=&quot;option-1-using-nginx-proxy-manager&quot;&gt;Option 1: Using Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#option-1-using-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Create a &lt;code&gt;docker-compose.yml&lt;/code&gt; file that includes both Home Assistant and Nginx Proxy Manager:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3&amp;#39;
services:
  homeassistant:
    container_name: homeassistant
    image: ghcr.io/home-assistant/home-assistant:stable
    volumes:
      - ~/homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    network_mode: host
    
  nginx-proxy-manager:
    container_name: nginx-proxy-manager
    image: &amp;#39;jc21/nginx-proxy-manager:latest&amp;#39;
    restart: unless-stopped
    ports:
      - &amp;#39;80:80&amp;#39;
      - &amp;#39;81:81&amp;#39;
      - &amp;#39;443:443&amp;#39;
    volumes:
      - ~/nginx-proxy-manager/data:/data
      - ~/nginx-proxy-manager/letsencrypt:/etc/letsencrypt
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Start the services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Access Nginx Proxy Manager at &lt;code&gt;http://YOUR_SERVER_IP:81&lt;/code&gt; and set up a proxy host for your Home Assistant instance, enabling SSL with Let&amp;#39;s Encrypt.&lt;/p&gt;&lt;h3 id=&quot;restrict-access-with-strong-authentication&quot;&gt;Restrict Access with Strong Authentication&lt;a class=&quot;h-anchor&quot; href=&quot;#restrict-access-with-strong-authentication&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Use a strong, unique password for your Home Assistant admin account&lt;/li&gt;&lt;li&gt;Enable Two-Factor Authentication in Home Assistant&lt;/li&gt;&lt;li&gt;Consider using a separate user account for day-to-day usage&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;configure-a-firewall&quot;&gt;Configure a Firewall&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-a-firewall&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install and configure UFW (Uncomplicated Firewall):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 8123/tcp  # Only if you need direct access to Home Assistant
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Verify the firewall status:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If you&amp;#39;re using a reverse proxy, you only need to allow ports 80 and 443 instead of 8123.&lt;/p&gt;&lt;h2 id=&quot;data-persistence-and-backup-procedures&quot;&gt;Data Persistence and Backup Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence-and-backup-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Protecting your Home Assistant configuration and data is essential for disaster recovery.&lt;/p&gt;&lt;h3 id=&quot;creating-regular-backups&quot;&gt;Creating Regular Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-regular-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;for-docker-installations&quot;&gt;For Docker Installations&lt;a class=&quot;h-anchor&quot; href=&quot;#for-docker-installations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Install the Auto Backup add-on in Home Assistant (if using Supervisor) or create a script for automated backups:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/homeassistant/backups
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a backup script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano ~/backup-homeassistant.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
TIMESTAMP=$(date +&amp;quot;%Y%m%d-%H%M%S&amp;quot;)
BACKUP_DIR=~/homeassistant/backups
mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/homeassistant-config-$TIMESTAMP.tar.gz -C ~/homeassistant config
echo &amp;quot;Backup created: $BACKUP_DIR/homeassistant-config-$TIMESTAMP.tar.gz&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make the script executable:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod +x ~/backup-homeassistant.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Set up a cron job to run backups weekly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;(crontab -l 2&amp;gt;/dev/null; echo &amp;quot;0 2 * * 0 $HOME/backup-homeassistant.sh&amp;quot;) | crontab -
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a compressed backup of your Home Assistant configuration directory every Sunday at 2 AM. If the backup fails, check that tar is installed and that you have sufficient disk space.&lt;/p&gt;&lt;h3 id=&quot;restoring-from-backup&quot;&gt;Restoring from Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#restoring-from-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you need to restore from a backup:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;tar -xzf ~/homeassistant/backups/homeassistant-config-TIMESTAMP.tar.gz -C ~/homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;TIMESTAMP&lt;/code&gt; with the actual timestamp of your backup file. If the restore fails, ensure the backup file exists and is not corrupted.&lt;/p&gt;&lt;h2 id=&quot;common-issues-and-solutions&quot;&gt;Common Issues and Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Here are some common issues users face when installing and running Home Assistant on Ubuntu:&lt;/p&gt;&lt;h3 id=&quot;cannot-access-home-assistant-web-interface&quot;&gt;Cannot Access Home Assistant Web Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#cannot-access-home-assistant-web-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Cannot connect to Home Assistant at http://YOUR_SERVER_IP:8123&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic Command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -v http://localhost:8123
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check if Home Assistant is running: &lt;code&gt;# For Docker: docker ps | grep homeassistant # For systemd service: sudo systemctl status home-assistant@homeassistant.service&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check firewall settings: &lt;code&gt;sudo ufw status&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Ensure the correct ports are open if using Docker: &lt;code&gt;docker run -d \ --name=homeassistant \ --network=host \ # Important for device discovery -v ~/homeassistant/config:/config \ ghcr.io/home-assistant/home-assistant:stable&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;home-assistant-container-starts-but-crashes&quot;&gt;Home Assistant Container Starts But Crashes&lt;a class=&quot;h-anchor&quot; href=&quot;#home-assistant-container-starts-but-crashes&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Container shows as running then stops after a few seconds&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic Command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker logs homeassistant
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check permissions on config directory: &lt;code&gt;sudo chown -R $(id -u):$(id -g) ~/homeassistant/config&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Ensure enough memory is available: &lt;code&gt;free -h&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Try starting with a clean configuration: &lt;code&gt;mv ~/homeassistant/config ~/homeassistant/config.bak mkdir -p ~/homeassistant/config docker restart homeassistant&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;z-wave-or-zigbee-devices-not-detected&quot;&gt;Z-Wave or Zigbee Devices Not Detected&lt;a class=&quot;h-anchor&quot; href=&quot;#z-wave-or-zigbee-devices-not-detected&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: USB devices connected to the host are not detected in Home Assistant&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic Command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ls -l /dev/tty*
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Add the correct device mapping to Docker: &lt;code&gt;docker stop homeassistant docker rm homeassistant docker run -d \ --name=homeassistant \ --restart=unless-stopped \ --network=host \ -v ~/homeassistant/config:/config \ -v /etc/localtime:/etc/localtime:ro \ --device=/dev/ttyACM0:/dev/ttyACM0 \ # Adjust device path as needed ghcr.io/home-assistant/home-assistant:stable&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Add your user to the dialout group: &lt;code&gt;sudo usermod -aG dialout $USER # Log out and back in for this to take effect&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;database-errors-after-upgrade&quot;&gt;Database Errors After Upgrade&lt;a class=&quot;h-anchor&quot; href=&quot;#database-errors-after-upgrade&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;: Database-related errors in Home Assistant logs after upgrading&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic Command&lt;/strong&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For Docker:
docker logs homeassistant | grep -i database

# For direct installation:
sudo journalctl -fu home-assistant@homeassistant.service | grep -i database
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Solutions&lt;/strong&gt;:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check database file permissions: &lt;code&gt;sudo chown -R homeassistant:homeassistant ~/homeassistant/config/home-assistant_v2.db*&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Create a backup before attempting repairs: &lt;code&gt;cp ~/homeassistant/config/home-assistant_v2.db ~/homeassistant/config/home-assistant_v2.db.bak&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;maintenance-procedures&quot;&gt;Maintenance Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Keeping your Home Assistant installation updated and properly maintained is essential for security and stability.&lt;/p&gt;&lt;h3 id=&quot;updating-home-assistant&quot;&gt;Updating Home Assistant&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-home-assistant&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;for-docker-installations-1&quot;&gt;For Docker Installations&lt;a class=&quot;h-anchor&quot; href=&quot;#for-docker-installations-1&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Pull the latest image
docker pull ghcr.io/home-assistant/home-assistant:stable

# Stop and remove the current container
docker stop homeassistant
docker rm homeassistant

# Start a new container with the latest image
docker run -d \
  --name=homeassistant \
  --restart=unless-stopped \
  --network=host \
  -v ~/homeassistant/config:/config \
  -v /etc/localtime:/etc/localtime:ro \
  ghcr.io/home-assistant/home-assistant:stable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If you&amp;#39;re using Docker Compose:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/
docker compose pull
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Always create a backup before updating. If the update fails, you can revert to the previous version by specifying the exact image tag.&lt;/p&gt;&lt;h4 id=&quot;for-direct-installations&quot;&gt;For Direct Installations&lt;a class=&quot;h-anchor&quot; href=&quot;#for-direct-installations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl stop home-assistant@homeassistant.service
sudo -u homeassistant -H -s
cd /srv/homeassistant
source bin/activate
pip3 install --upgrade homeassistant
exit
sudo systemctl start home-assistant@homeassistant.service
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;monitoring-home-assistant&quot;&gt;Monitoring Home Assistant&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-home-assistant&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install monitoring tools to keep track of your Home Assistant instance:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y htop iotop
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Monitor system resources:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;htop
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Monitor disk I/O:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo iotop
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;View Home Assistant logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For Docker:
docker logs -f homeassistant

# For direct installation:
sudo journalctl -fu home-assistant@homeassistant.service
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You&amp;#39;ve now successfully installed and secured Home Assistant on your Ubuntu 20.04+ system. Whether you chose the Docker method for flexibility, the VM approach for isolation, or direct installation for simplicity, you now have a powerful home automation platform at your fingertips.&lt;/p&gt;&lt;p&gt;Remember to keep your system and Home Assistant updated regularly, create backups before making significant changes, and refer to the official Home Assistant documentation for detailed information about specific integrations and features.&lt;/p&gt;&lt;p&gt;With Home Assistant, you&amp;#39;re well on your way to creating a smarter, more automated home that respects your privacy and works exactly the way you want it to.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing and Hosting Nextcloud on Ubuntu 20.04+</title><link>https://diylabhub.com/complete-guide-to-installing-and-hosting-nextcloud-on-ubuntu-20-04/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-hosting-nextcloud-on-ubuntu-20-04/</guid><pubDate>Sun, 09 Mar 2025 04:28:24 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction-what-is-nextcloud-and-why-self-host&quot;&gt;Introduction: What is Nextcloud and Why Self-Host?&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction-what-is-nextcloud-and-why-self-host&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Nextcloud is a powerful open-source file sharing and collaboration platform that gives you complete control over your data. Unlike third-party cloud services like Dropbox or Google Drive, Nextcloud allows you to host your own private cloud on your server, ensuring data privacy and security while offering similar functionality including file storage, sharing, calendars, contacts, and more through its extensible app system.&lt;/p&gt;&lt;p&gt;Self-hosting Nextcloud provides several key benefits:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Complete data privacy and control&lt;/li&gt;&lt;li&gt;No subscription fees (beyond hosting costs)&lt;/li&gt;&lt;li&gt;Customizable features through the app ecosystem&lt;/li&gt;&lt;li&gt;Scalable storage based on your hardware&lt;/li&gt;&lt;li&gt;Freedom from vendor lock-in&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This guide walks you through two installation methods with minimal manual intervention required.&lt;/p&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before beginning, ensure you have:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;# System requirements
Ubuntu 20.04 LTS or newer
Root or sudo access to the server
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Hardware requirements:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;2GB RAM (4GB+ recommended for production use)&lt;/li&gt;&lt;li&gt;2 CPU cores (more for multi-user environments)&lt;/li&gt;&lt;li&gt;At least 10GB storage space (plus additional space for your data)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Network requirements:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A domain name pointed to your server (for secure HTTPS access)&lt;/li&gt;&lt;li&gt;Open ports in your firewall: &lt;code&gt;80/TCP (HTTP)443/TCP (HTTPS)&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;installation-methods&quot;&gt;Installation Methods&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-methods&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Choose between two installation approaches:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Traditional LAMP Stack Installation&lt;/strong&gt; - More customizable, better for production environments&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Snap Package Installation&lt;/strong&gt; - Simpler, faster setup with automatic updates&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;method-1-traditional-lamp-stack-installation&quot;&gt;Method 1: Traditional LAMP Stack Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#method-1-traditional-lamp-stack-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-update-your-system&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Update Your System&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-update-your-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates package lists and upgrades all installed packages to their latest versions.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-lamp-stack&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install LAMP Stack&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-lamp-stack&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install apache2 mariadb-server libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip php-mysql php-bcmath php-gmp -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the web server, database server, and all required PHP extensions for Nextcloud.&lt;/p&gt;&lt;h3 id=&quot;step-3-configure-mariadb&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure MariaDB&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-configure-mariadb&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Secure your MariaDB installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mysql_secure_installation
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Follow the prompts to set a root password and secure your database. When asked, answer &amp;#39;Y&amp;#39; to all security questions.&lt;/p&gt;&lt;p&gt;Create a database and user for Nextcloud:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mysql -u root -p
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;When the MySQL prompt appears, run:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;CREATE DATABASE nextcloud;
CREATE USER &amp;#39;nextclouduser&amp;#39;@&amp;#39;localhost&amp;#39; IDENTIFIED BY &amp;#39;your-strong-password&amp;#39;;
GRANT ALL PRIVILEGES ON nextcloud.* TO &amp;#39;nextclouduser&amp;#39;@&amp;#39;localhost&amp;#39;;
FLUSH PRIVILEGES;
EXIT;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;#39;your-strong-password&amp;#39; with a secure password. This creates a dedicated database and user for Nextcloud.&lt;/p&gt;&lt;h3 id=&quot;step-4-configure-php&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure PHP&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-configure-php&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/php/7.4/apache2/php.ini
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For Ubuntu 22.04, use &lt;code&gt;8.1&lt;/code&gt; instead of &lt;code&gt;7.4&lt;/code&gt; in the path.&lt;/p&gt;&lt;p&gt;Find and modify these values:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;memory_limit = 512M
upload_max_filesize = 200M
max_execution_time = 360
post_max_size = 200M
date.timezone = Your/Timezone
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;Your/Timezone&lt;/code&gt; with your actual timezone (e.g., &lt;code&gt;America/New_York&lt;/code&gt;). These settings optimize PHP for file uploads and Nextcloud operations.&lt;/p&gt;&lt;h3 id=&quot;step-5-download-and-extract-nextcloud&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Download and Extract Nextcloud&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-download-and-extract-nextcloud&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd /tmp
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads the latest stable Nextcloud version.&lt;/p&gt;&lt;p&gt;Extract and move to web directory:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo tar -xjf latest.tar.bz2
sudo mv nextcloud /var/www/html/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This extracts Nextcloud and places it in the Apache web root directory.&lt;/p&gt;&lt;h3 id=&quot;step-6-set-correct-permissions&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Correct Permissions&lt;a class=&quot;h-anchor&quot; href=&quot;#step-6-set-correct-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R www-data:www-data /var/www/html/nextcloud/
sudo chmod -R 755 /var/www/html/nextcloud/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures the web server can access and modify Nextcloud files. Incorrect permissions will cause installation or operation failures.&lt;/p&gt;&lt;h3 id=&quot;step-7-configure-apache-for-nextcloud&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Apache for Nextcloud&lt;a class=&quot;h-anchor&quot; href=&quot;#step-7-configure-apache-for-nextcloud&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/apache2/sites-available/nextcloud.conf
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add this configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerName your-domain.com
    DocumentRoot /var/www/html/nextcloud/

    &amp;lt;Directory /var/www/html/nextcloud/&amp;gt;
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
        &amp;lt;IfModule mod_dav.c&amp;gt;
            Dav off
        &amp;lt;/IfModule&amp;gt;
        SetEnv HOME /var/www/html/nextcloud
        SetEnv HTTP_HOME /var/www/html/nextcloud
    &amp;lt;/Directory&amp;gt;

    ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
    CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
&amp;lt;/VirtualHost&amp;gt;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-domain.com&lt;/code&gt; with your actual domain name.&lt;/p&gt;&lt;p&gt;Enable the site and required Apache modules:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo a2ensite nextcloud.conf
sudo a2enmod rewrite headers env dir mime setenvif ssl
sudo systemctl restart apache2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This activates the Nextcloud site and enables necessary Apache modules.&lt;/p&gt;&lt;h3 id=&quot;step-8-set-up-ssl-with-lets-encrypt&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Set Up SSL with Let&amp;#39;s Encrypt&lt;a class=&quot;h-anchor&quot; href=&quot;#step-8-set-up-ssl-with-lets-encrypt&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d your-domain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-domain.com&lt;/code&gt; with your actual domain. This obtains and installs a free SSL certificate.&lt;/p&gt;&lt;h3 id=&quot;step-9-complete-the-web-based-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Complete the Web-Based Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#step-9-complete-the-web-based-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your web browser and navigate to &lt;code&gt;https://your-domain.com&lt;/code&gt;. You&amp;#39;ll see the Nextcloud setup page where you&amp;#39;ll enter:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Admin username and password&lt;/li&gt;&lt;li&gt;Data folder: Keep the default &lt;code&gt;/var/www/html/nextcloud/data&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Database user: &lt;code&gt;nextclouduser&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Database password: The password you set in Step 3&lt;/li&gt;&lt;li&gt;Database name: &lt;code&gt;nextcloud&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Database host: &lt;code&gt;localhost&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Click &amp;quot;Finish setup&amp;quot; to complete the installation.&lt;/p&gt;&lt;h2 id=&quot;method-2-snap-package-installation-simplified-approach&quot;&gt;Method 2: Snap Package Installation (Simplified Approach)&lt;a class=&quot;h-anchor&quot; href=&quot;#method-2-snap-package-installation-simplified-approach&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;step-1-install-snapd&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Snapd&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-install-snapd&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install snapd -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs the snap package manager.&lt;/p&gt;&lt;h3 id=&quot;step-2-install-nextcloud-via-snap&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Install Nextcloud via Snap&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-install-nextcloud-via-snap&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo snap install nextcloud
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads and installs Nextcloud with all dependencies.&lt;/p&gt;&lt;h3 id=&quot;step-3-create-admin-account&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create Admin Account&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-create-admin-account&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nextcloud.manual-install admin &amp;quot;your-strong-password&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-strong-password&lt;/code&gt; with a secure password. This creates the admin account.&lt;/p&gt;&lt;h3 id=&quot;step-4-configure-domain&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Configure Domain&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-configure-domain&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nextcloud.occ config:system:set trusted_domains 1 --value=your-domain.com
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your-domain.com&lt;/code&gt; with your actual domain.&lt;/p&gt;&lt;h3 id=&quot;step-5-enable-https&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Enable HTTPS&lt;a class=&quot;h-anchor&quot; href=&quot;#step-5-enable-https&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nextcloud.enable-https lets-encrypt
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Enter your email address and agree to the terms when prompted. This obtains and installs a free SSL certificate.&lt;/p&gt;&lt;h2 id=&quot;security-hardening&quot;&gt;Security Hardening&lt;a class=&quot;h-anchor&quot; href=&quot;#security-hardening&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configure-basic-firewall&quot;&gt;Configure Basic Firewall&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-basic-firewall&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install ufw -y
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This installs and configures UFW firewall, allowing only SSH and web traffic.&lt;/p&gt;&lt;h3 id=&quot;protect-against-brute-force-attacks-with-fail2ban&quot;&gt;Protect Against Brute Force Attacks with Fail2ban&lt;a class=&quot;h-anchor&quot; href=&quot;#protect-against-brute-force-attacks-with-fail2ban&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install fail2ban -y
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add to the end of the file:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[nextcloud]
enabled = true
port = 80,443
filter = nextcloud
logpath = /var/log/apache2/nextcloud_access.log
maxretry = 3
bantime = 86400
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For snap installations, use &lt;code&gt;/var/snap/nextcloud/current/logs/nextcloud.log&lt;/code&gt; as the logpath.&lt;/p&gt;&lt;p&gt;Create a filter:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/fail2ban/filter.d/nextcloud.conf
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Definition]
failregex = ^.*Login failed: &amp;#39;.*&amp;#39; \(Remote IP: &amp;#39;&amp;#39;.*$
ignoreregex =
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart Fail2ban:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart fail2ban
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This protects your login page from repeated password attempts.&lt;/p&gt;&lt;h2 id=&quot;data-management-and-backups&quot;&gt;Data Management and Backups&lt;a class=&quot;h-anchor&quot; href=&quot;#data-management-and-backups&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configure-external-storage-traditional-installation&quot;&gt;Configure External Storage (Traditional Installation)&lt;a class=&quot;h-anchor&quot; href=&quot;#configure-external-storage-traditional-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir -p /var/nextcloud-data
sudo chown -R www-data:www-data /var/nextcloud-data
sudo chmod -R 750 /var/nextcloud-data
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Edit Nextcloud config:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /var/www/html/nextcloud/config/config.php
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Update the &lt;code&gt;datadirectory&lt;/code&gt; parameter:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&amp;#39;datadirectory&amp;#39; =&amp;gt; &amp;#39;/var/nextcloud-data&amp;#39;,
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;automated-backup-script-traditional-installation&quot;&gt;Automated Backup Script (Traditional Installation)&lt;a class=&quot;h-anchor&quot; href=&quot;#automated-backup-script-traditional-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /usr/local/bin/nextcloud-backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add this script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;#!/bin/bash
BACKUP_DATE=$(date +&amp;quot;%Y%m%d&amp;quot;)
BACKUP_DIR=&amp;quot;/var/backups/nextcloud&amp;quot;

# Create backup directory if it doesn&amp;#39;t exist
mkdir -p $BACKUP_DIR

# Enable maintenance mode
cd /var/www/html/nextcloud
sudo -u www-data php occ maintenance:mode --on

# Backup database
mysqldump --single-transaction -u nextclouduser -p&amp;#39;your-strong-password&amp;#39; nextcloud &amp;gt; $BACKUP_DIR/nextcloud-db-$BACKUP_DATE.sql

# Backup data directory
tar -czf $BACKUP_DIR/nextcloud-data-$BACKUP_DATE.tar.gz -C /var /var/nextcloud-data

# Backup config directory
tar -czf $BACKUP_DIR/nextcloud-config-$BACKUP_DATE.tar.gz -C /var/www/html/nextcloud config

# Disable maintenance mode
sudo -u www-data php occ maintenance:mode --off

# Remove backups older than 30 days
find $BACKUP_DIR -name &amp;quot;nextcloud-*&amp;quot; -type f -mtime +30 -delete
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make it executable and schedule:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chmod +x /usr/local/bin/nextcloud-backup.sh
sudo crontab -e
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add this line for daily 2AM backups:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;0 2 * * * /usr/local/bin/nextcloud-backup.sh
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;snap-installation-backup&quot;&gt;Snap Installation Backup&lt;a class=&quot;h-anchor&quot; href=&quot;#snap-installation-backup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nextcloud.export
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a complete backup in &lt;code&gt;/var/snap/nextcloud/common/backups/&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Schedule automated backups:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo crontab -e
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;0 2 * * * /snap/bin/nextcloud.export
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;fix-permission-denied-errors&quot;&gt;Fix Permission Denied Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#fix-permission-denied-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R www-data:www-data /var/www/html/nextcloud/
sudo find /var/www/html/nextcloud/ -type d -exec chmod 750 {} \;
sudo find /var/www/html/nextcloud/ -type f -exec chmod 640 {} \;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This resets ownership and permissions to correct values.&lt;/p&gt;&lt;h3 id=&quot;resolve-database-connection-issues&quot;&gt;Resolve Database Connection Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#resolve-database-connection-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mysql -u root -p
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Then run:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;GRANT ALL PRIVILEGES ON nextcloud.* TO &amp;#39;nextclouduser&amp;#39;@&amp;#39;localhost&amp;#39;;
FLUSH PRIVILEGES;
EXIT;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures the database user has proper permissions.&lt;/p&gt;&lt;h3 id=&quot;fix-php-memory-limit-errors&quot;&gt;Fix PHP Memory Limit Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#fix-php-memory-limit-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/php/7.4/apache2/php.ini
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For Ubuntu 22.04, use &lt;code&gt;8.1&lt;/code&gt; instead of &lt;code&gt;7.4&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Change the memory limit:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;memory_limit = 1G
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart Apache:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart apache2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This increases PHP memory to handle larger operations.&lt;/p&gt;&lt;h3 id=&quot;improve-performance-with-redis-caching&quot;&gt;Improve Performance with Redis Caching&lt;a class=&quot;h-anchor&quot; href=&quot;#improve-performance-with-redis-caching&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install redis-server php-redis -y
sudo systemctl enable redis-server
sudo systemctl start redis-server
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Edit Nextcloud config:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /var/www/html/nextcloud/config/config.php
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add inside the configuration array:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&amp;#39;memcache.local&amp;#39; =&amp;gt; &amp;#39;\\OC\\Memcache\\Redis&amp;#39;,
&amp;#39;memcache.locking&amp;#39; =&amp;gt; &amp;#39;\\OC\\Memcache\\Redis&amp;#39;,
&amp;#39;redis&amp;#39; =&amp;gt; [
     &amp;#39;host&amp;#39; =&amp;gt; &amp;#39;localhost&amp;#39;,
     &amp;#39;port&amp;#39; =&amp;gt; 6379,
],
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restart Apache:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart apache2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This significantly improves performance through caching.&lt;/p&gt;&lt;h2 id=&quot;maintenance-tasks&quot;&gt;Maintenance Tasks&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-tasks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;update-nextcloud-traditional-installation&quot;&gt;Update Nextcloud (Traditional Installation)&lt;a class=&quot;h-anchor&quot; href=&quot;#update-nextcloud-traditional-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd /var/www/html/nextcloud
sudo -u www-data php occ maintenance:mode --on
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Backup first:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mysqldump --single-transaction -u nextclouduser -p&amp;#39;your-strong-password&amp;#39; nextcloud &amp;gt; /var/backups/nextcloud-db-before-update.sql
sudo tar -czf /var/backups/nextcloud-before-update.tar.gz -C /var/www/html nextcloud
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Download and update:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd /tmp
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
sudo tar -xjf latest.tar.bz2
sudo cp -r nextcloud/. /var/www/html/nextcloud/
sudo chown -R www-data:www-data /var/www/html/nextcloud/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Complete the upgrade:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd /var/www/html/nextcloud
sudo -u www-data php occ upgrade
sudo -u www-data php occ maintenance:mode --off
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;update-snap-installation&quot;&gt;Update Snap Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#update-snap-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo snap refresh nextcloud
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates Nextcloud to the latest version.&lt;/p&gt;&lt;h3 id=&quot;monitor-your-installation&quot;&gt;Monitor Your Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#monitor-your-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check status:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For traditional installation
cd /var/www/html/nextcloud
sudo -u www-data php occ status

# For snap installation
sudo nextcloud.occ status
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;View logs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For traditional installation
sudo tail -f /var/log/apache2/nextcloud_error.log

# For snap installation
sudo snap logs nextcloud
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;These commands help diagnose issues.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully functional, secure Nextcloud installation on your Ubuntu server. Your self-hosted cloud provides a private alternative to commercial services with similar features.&lt;/p&gt;&lt;p&gt;Remember to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Keep your system updated regularly&lt;/li&gt;&lt;li&gt;Back up your data frequently&lt;/li&gt;&lt;li&gt;Monitor logs for unusual activity&lt;/li&gt;&lt;li&gt;Follow security best practices&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;For basic usage, you can stop after completing either installation method and securing with SSL. For production environments, consider implementing the security hardening and performance optimization steps.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing and Configuring ComfyUI on Ubuntu</title><link>https://diylabhub.com/complete-guide-to-installing-and-configuring-comfyui-on-ubuntu/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-configuring-comfyui-on-ubuntu/</guid><pubDate>Sat, 08 Mar 2025 06:22:50 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;This guide will walk you through installing and configuring ComfyUI on Ubuntu with simple, copy-pastable commands. I&amp;#39;ve designed this to be as straightforward as possible, explaining each step along the way.&lt;/p&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;ComfyUI is a powerful tool for creating AI-generated images using Stable Diffusion models. It uses a visual, node-based interface where you connect different components together - kind of like building with blocks. This makes it much easier to use than typing commands.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What you&amp;#39;ll get when you&amp;#39;re done:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;A working ComfyUI installation on your Ubuntu computer&lt;/li&gt;&lt;li&gt;The ability to generate AI images with various models&lt;/li&gt;&lt;li&gt;ComfyUI running as a system service (starting automatically when your computer boots)&lt;/li&gt;&lt;li&gt;Optional: Access to ComfyUI from other devices on your network&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before we start, you&amp;#39;ll need:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;An Ubuntu computer (version 20.04 or newer)&lt;/li&gt;&lt;li&gt;Administrator access (ability to use sudo commands)&lt;/li&gt;&lt;li&gt;At least 8GB of RAM (16GB or more is better)&lt;/li&gt;&lt;li&gt;A graphics card (GPU) with at least 4GB of memory&lt;/li&gt;&lt;li&gt;Internet connection&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Don&amp;#39;t worry if you&amp;#39;re not sure about some of these requirements - we&amp;#39;ll check them as we go.&lt;/p&gt;&lt;h2 id=&quot;1-system-update-and-basic-dependencies&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;System Update and Basic Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#1-system-update-and-basic-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;First, let&amp;#39;s make sure your system is up to date and has the basic software we need.&lt;/p&gt;&lt;p&gt;Open a terminal window by pressing Ctrl+Alt+T on your keyboard, then copy and paste these commands:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt upgrade -y
sudo apt install -y git python3 python3-pip python3-venv
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Updates your system&amp;#39;s package list&lt;/li&gt;&lt;li&gt;Upgrades any outdated packages&lt;/li&gt;&lt;li&gt;Installs Git (for downloading ComfyUI), Python (the programming language ComfyUI uses), and tools for creating isolated Python environments&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;2-graphics-driver-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Graphics Driver Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#2-graphics-driver-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For ComfyUI to work well, you need proper drivers for your graphics card. We&amp;#39;ll cover both NVIDIA and AMD installations. &lt;strong&gt;You only need to follow the section that matches your graphics card type.&lt;/strong&gt;&lt;/p&gt;&lt;h3 id=&quot;21-checking-your-graphics-card-type&quot;&gt;2.1 Checking Your Graphics Card Type&lt;a class=&quot;h-anchor&quot; href=&quot;#21-checking-your-graphics-card-type&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Not sure what graphics card you have? Run this command:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;lspci | grep -E &amp;quot;VGA|3D|Display&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Look at the output - if you see &amp;quot;NVIDIA&amp;quot; in the results, follow the NVIDIA instructions. If you see &amp;quot;AMD&amp;quot; or &amp;quot;Radeon,&amp;quot; follow the AMD instructions.&lt;/p&gt;&lt;h3 id=&quot;22-for-nvidia-gpus&quot;&gt;2.2 For NVIDIA GPUs&lt;a class=&quot;h-anchor&quot; href=&quot;#22-for-nvidia-gpus&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;221-disable-the-default-open-source-driver&quot;&gt;2.2.1 Disable the Default Open-Source Driver&lt;a class=&quot;h-anchor&quot; href=&quot;#221-disable-the-default-open-source-driver&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The default open-source driver (Nouveau) doesn&amp;#39;t work well for AI tasks. We need to disable it:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;#39;blacklist nouveau&amp;#39; | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
echo &amp;#39;options nouveau modeset=0&amp;#39; | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
sudo update-initramfs -u
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Prevents the basic open-source driver from loading, so we can use NVIDIA&amp;#39;s better-performing driver instead.&lt;/p&gt;&lt;h4 id=&quot;222-install-nvidia-driver&quot;&gt;2.2.2 Install NVIDIA Driver&lt;a class=&quot;h-anchor&quot; href=&quot;#222-install-nvidia-driver&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
ubuntu-drivers devices
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;The last command will show you available drivers. Look for a line that says &amp;quot;recommended&amp;quot; - note that version number.&lt;/p&gt;&lt;p&gt;Now install the recommended driver (replace &amp;quot;550&amp;quot; with your recommended version):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y nvidia-driver-550
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you already have the NVIDIA driver installed, you&amp;#39;ll see a message saying it&amp;#39;s already the newest version. That&amp;#39;s fine - you can continue to the next step.&lt;/p&gt;&lt;h4 id=&quot;223-reboot-your-system&quot;&gt;2.2.3 Reboot Your System&lt;a class=&quot;h-anchor&quot; href=&quot;#223-reboot-your-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo reboot
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After your computer restarts, open a terminal again and continue.&lt;/p&gt;&lt;h4 id=&quot;224-verify-the-driver-installation&quot;&gt;2.2.4 Verify the Driver Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#224-verify-the-driver-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see information about your GPU and the installed driver. If you see an error message instead, the driver installation might have failed - try rebooting again or checking for error messages.&lt;/p&gt;&lt;h3 id=&quot;23-for-amd-gpus&quot;&gt;2.3 For AMD GPUs&lt;a class=&quot;h-anchor&quot; href=&quot;#23-for-amd-gpus&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;h4 id=&quot;231-install-amd-gpu-drivers&quot;&gt;2.3.1 Install AMD GPU Drivers&lt;a class=&quot;h-anchor&quot; href=&quot;#231-install-amd-gpu-drivers&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;For Ubuntu 22.04 or newer:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo mkdir --parents --mode=0755 /etc/apt/keyrings
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
    gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg &amp;gt; /dev/null

echo &amp;quot;deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/6.0.2/ubuntu jammy main&amp;quot; \
    | sudo tee /etc/apt/sources.list.d/amdgpu.list
sudo apt update

sudo apt install -y amdgpu-dkms
sudo usermod -a -G render,video $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Adds AMD&amp;#39;s software repository to your system&lt;/li&gt;&lt;li&gt;Installs the AMD GPU drivers&lt;/li&gt;&lt;li&gt;Adds your user account to the groups needed to use the GPU&lt;/li&gt;&lt;/ul&gt;&lt;h4 id=&quot;232-reboot-your-system&quot;&gt;2.3.2 Reboot Your System&lt;a class=&quot;h-anchor&quot; href=&quot;#232-reboot-your-system&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo reboot
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;3-comfyui-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;ComfyUI Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#3-comfyui-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now let&amp;#39;s install ComfyUI itself.&lt;/p&gt;&lt;h3 id=&quot;31-clone-the-repository&quot;&gt;3.1 Clone the Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#31-clone-the-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This downloads the ComfyUI software to your computer:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;32-create-and-activate-a-virtual-environment&quot;&gt;3.2 Create and Activate a Virtual Environment&lt;a class=&quot;h-anchor&quot; href=&quot;#32-create-and-activate-a-virtual-environment&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A virtual environment is like a separate container for Python packages. It keeps ComfyUI&amp;#39;s dependencies separate from your system&amp;#39;s Python installation:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;python3 -m venv venv
source venv/bin/activate
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You&amp;#39;ll notice your terminal prompt now starts with &lt;code&gt;(venv)&lt;/code&gt;, showing you&amp;#39;re in the virtual environment.&lt;/p&gt;&lt;h3 id=&quot;33-install-pytorch&quot;&gt;3.3 Install PyTorch&lt;a class=&quot;h-anchor&quot; href=&quot;#33-install-pytorch&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;PyTorch is a machine learning framework that ComfyUI needs. We&amp;#39;ll install different versions depending on your graphics card.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;For NVIDIA GPUs:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;For AMD GPUs:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Installs PyTorch with the right settings for your graphics card type.&lt;/p&gt;&lt;h3 id=&quot;34-install-required-dependencies&quot;&gt;3.4 Install Required Dependencies&lt;a class=&quot;h-anchor&quot; href=&quot;#34-install-required-dependencies&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now let&amp;#39;s install the rest of the software packages ComfyUI needs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pip install -r requirements.txt
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This might take a few minutes, as it&amp;#39;s downloading and installing several packages.&lt;/p&gt;&lt;h3 id=&quot;35-test-comfyui&quot;&gt;3.5 Test ComfyUI&lt;a class=&quot;h-anchor&quot; href=&quot;#35-test-comfyui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Let&amp;#39;s make sure ComfyUI works before setting it up permanently:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;python main.py
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see some messages in the terminal, eventually showing something like &amp;quot;Running on local URL: http://127.0.0.1:8188&amp;quot;.&lt;/p&gt;&lt;p&gt;Open a web browser and go to: http://127.0.0.1:8188&lt;/p&gt;&lt;p&gt;You should see the ComfyUI interface. If it works, go back to the terminal and press Ctrl+C to stop ComfyUI.&lt;/p&gt;&lt;h2 id=&quot;4-adding-stable-diffusion-models&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Adding Stable Diffusion Models&lt;a class=&quot;h-anchor&quot; href=&quot;#4-adding-stable-diffusion-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;ComfyUI needs at least one AI model to generate images.&lt;/p&gt;&lt;h3 id=&quot;41-create-the-models-directory&quot;&gt;4.1 Create the Models Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#41-create-the-models-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p models/checkpoints
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;42-download-a-model&quot;&gt;4.2 Download a Model&lt;a class=&quot;h-anchor&quot; href=&quot;#42-download-a-model&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You&amp;#39;ll need to download a Stable Diffusion model file (with a .ckpt or .safetensors extension) and place it in the models/checkpoints directory.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Where to find models:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Hugging Face (https://huggingface.co/models?other=stable-diffusion)&lt;/li&gt;&lt;li&gt;Civitai (https://civitai.com/)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Popular models for beginners:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Stable Diffusion 1.5&lt;/li&gt;&lt;li&gt;Realistic Vision&lt;/li&gt;&lt;li&gt;Dreamshaper&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;After downloading a model, move it to the checkpoints folder:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# If you downloaded to your Downloads folder:
mv ~/Downloads/your-model-name.safetensors ~/ComfyUI/models/checkpoints/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &amp;quot;your-model-name.safetensors&amp;quot; with your actual downloaded file name.&lt;/p&gt;&lt;h2 id=&quot;5-setting-up-comfyui-as-a-system-service&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Setting Up ComfyUI as a System Service&lt;a class=&quot;h-anchor&quot; href=&quot;#5-setting-up-comfyui-as-a-system-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now we&amp;#39;ll set up ComfyUI to run automatically in the background, even after you restart your computer.&lt;/p&gt;&lt;h3 id=&quot;51-check-if-default-port-8188-is-available&quot;&gt;5.1 Check if Default Port (8188) is Available&lt;a class=&quot;h-anchor&quot; href=&quot;#51-check-if-default-port-8188-is-available&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, let&amp;#39;s make sure the default port (8188) isn&amp;#39;t already being used by another program:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo netstat -tuln | grep 8188
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If this command doesn&amp;#39;t return anything, the port is available, and you can continue. If it shows something, that means the port is already in use. In that case, we&amp;#39;ll need to use a different port:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# This finds an unused port
port=$(python3 -c &amp;#39;import socket; s=socket.socket(); s.bind((&amp;quot;&amp;quot;, 0)); print(s.getsockname()[1]); s.close()&amp;#39;)
echo &amp;quot;Free port: $port&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Make note of the port number it gives you - we&amp;#39;ll use it in the next step.&lt;/p&gt;&lt;h3 id=&quot;52-create-a-service-file&quot;&gt;5.2 Create a Service File&lt;a class=&quot;h-anchor&quot; href=&quot;#52-create-a-service-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This file tells your system how to run ComfyUI as a background service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo nano /etc/systemd/system/comfyui.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;A text editor will open. Copy and paste the following text, then replace &lt;code&gt;YOUR_USERNAME&lt;/code&gt; with your actual username (the name you use to log in to your computer):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Unit]
Description=ComfyUI Service
After=network.target

[Service]
Type=simple
User=YOUR_USERNAME
Group=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/ComfyUI
Environment=PATH=/home/YOUR_USERNAME/ComfyUI/venv/bin:$PATH
ExecStart=/home/YOUR_USERNAME/ComfyUI/venv/bin/python main.py --listen 0.0.0.0 --port 8188
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Important notes:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;If you need to use a different port (from step 5.1), change &lt;code&gt;--port 8188&lt;/code&gt; to use your port number&lt;/li&gt;&lt;li&gt;The &lt;code&gt;--listen 0.0.0.0&lt;/code&gt; part allows ComfyUI to be accessed from other devices on your network, not just from your computer&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Save the file by pressing Ctrl+X, then Y, then Enter.&lt;/p&gt;&lt;h3 id=&quot;53-enable-and-start-the-service&quot;&gt;5.3 Enable and Start the Service&lt;a class=&quot;h-anchor&quot; href=&quot;#53-enable-and-start-the-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now let&amp;#39;s register and start the service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl daemon-reload
sudo systemctl enable comfyui
sudo systemctl start comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Reloads the service configuration&lt;/li&gt;&lt;li&gt;Sets ComfyUI to start automatically when your computer boots&lt;/li&gt;&lt;li&gt;Starts ComfyUI right now&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;54-check-service-status&quot;&gt;5.4 Check Service Status&lt;a class=&quot;h-anchor&quot; href=&quot;#54-check-service-status&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Let&amp;#39;s make sure the service is running properly:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl status comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;You should see &amp;quot;active (running)&amp;quot; in green text. Press Q to exit this view.&lt;/p&gt;&lt;h3 id=&quot;55-access-comfyui&quot;&gt;5.5 Access ComfyUI&lt;a class=&quot;h-anchor&quot; href=&quot;#55-access-comfyui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Now you can access ComfyUI by opening a web browser and going to:&lt;/p&gt;&lt;p&gt;http://localhost:8188&lt;/p&gt;&lt;p&gt;(If you used a different port, replace 8188 with your port number)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;To access from other devices on your network:&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Find your computer&amp;#39;s IP address:&lt;/li&gt;&lt;/ol&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;hostname -I | awk &amp;#39;{print $1}&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;ol start=&quot;2&quot;&gt;&lt;li&gt;On another device on the same network, open a browser and go to: http://YOUR_IP_ADDRESS:8188 (Replace YOUR_IP_ADDRESS with the address from step 1)&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;6-optional-integrating-with-nginx-proxy-manager&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Optional: Integrating with Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#6-optional-integrating-with-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This section is completely optional. It&amp;#39;s useful if you want to:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Access ComfyUI using a custom domain name instead of an IP address and port&lt;/li&gt;&lt;li&gt;Add password protection&lt;/li&gt;&lt;li&gt;Set up HTTPS for secure access&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;61-install-docker-and-docker-compose-if-not-already-installed&quot;&gt;6.1 Install Docker and Docker Compose (if not already installed)&lt;a class=&quot;h-anchor&quot; href=&quot;#61-install-docker-and-docker-compose-if-not-already-installed&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, check if Docker is already installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker --version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;If you see version information, Docker is already installed and you can skip to step 6.2.&lt;/p&gt;&lt;p&gt;If not, install Docker:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker.io docker-compose
sudo usermod -aG docker $USER
sudo systemctl enable docker
sudo systemctl start docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; After adding yourself to the docker group, you need to log out and log back in for the change to take effect. You can do this by restarting your computer or logging out and back in.&lt;/p&gt;&lt;h3 id=&quot;62-create-a-directory-for-nginx-proxy-manager&quot;&gt;6.2 Create a Directory for Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#62-create-a-directory-for-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;mkdir -p ~/docker/nginx-proxy-manager
cd ~/docker/nginx-proxy-manager
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;63-create-docker-compose-file&quot;&gt;6.3 Create Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#63-create-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano docker-compose.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Copy and paste the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3&amp;#39;
services:
  app:
    image: &amp;#39;jc21/nginx-proxy-manager:latest&amp;#39;
    restart: unless-stopped
    ports:
      - &amp;#39;80:80&amp;#39;
      - &amp;#39;81:81&amp;#39;
      - &amp;#39;443:443&amp;#39;
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save the file (Ctrl+X, then Y, then Enter).&lt;/p&gt;&lt;h3 id=&quot;64-start-nginx-proxy-manager&quot;&gt;6.4 Start Nginx Proxy Manager&lt;a class=&quot;h-anchor&quot; href=&quot;#64-start-nginx-proxy-manager&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Downloads and starts Nginx Proxy Manager in a Docker container.&lt;/p&gt;&lt;h3 id=&quot;65-access-the-nginx-proxy-manager-dashboard&quot;&gt;6.5 Access the Nginx Proxy Manager Dashboard&lt;a class=&quot;h-anchor&quot; href=&quot;#65-access-the-nginx-proxy-manager-dashboard&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your browser and go to http://YOUR_IP_ADDRESS:81&lt;/p&gt;&lt;p&gt;Replace YOUR_IP_ADDRESS with your computer&amp;#39;s IP address (from the &lt;code&gt;hostname -I&lt;/code&gt; command earlier).&lt;/p&gt;&lt;p&gt;Default login credentials:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Email: admin@example.com&lt;/li&gt;&lt;li&gt;Password: changeme&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You&amp;#39;ll be prompted to change these after your first login.&lt;/p&gt;&lt;h3 id=&quot;66-create-a-proxy-host-for-comfyui&quot;&gt;6.6 Create a Proxy Host for ComfyUI&lt;a class=&quot;h-anchor&quot; href=&quot;#66-create-a-proxy-host-for-comfyui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;In the dashboard, go to &amp;quot;Proxy Hosts&amp;quot; and click &amp;quot;Add Proxy Host&amp;quot;&lt;/li&gt;&lt;li&gt;Fill in the form:&lt;ul&gt;&lt;li&gt;Domain Name: Enter a name you want to use (e.g., comfyui.local)&lt;/li&gt;&lt;li&gt;Scheme: http&lt;/li&gt;&lt;li&gt;Forward Hostname/IP: Your computer&amp;#39;s IP address&lt;/li&gt;&lt;li&gt;Forward Port: 8188 (or your custom port)&lt;/li&gt;&lt;li&gt;Check &amp;quot;Block Common Exploits&amp;quot; for better security&lt;/li&gt;&lt;li&gt;You can also enable SSL if you want HTTPS access&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Save the configuration&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;7-optional-pi-hole-configuration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Optional: Pi-hole Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#7-optional-pi-hole-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This section is only relevant if you&amp;#39;re already using Pi-hole for DNS on your network. If you don&amp;#39;t know what Pi-hole is, you can skip this section.&lt;/p&gt;&lt;h3 id=&quot;71-add-a-local-dns-record-for-comfyui&quot;&gt;7.1 Add a Local DNS Record for ComfyUI&lt;a class=&quot;h-anchor&quot; href=&quot;#71-add-a-local-dns-record-for-comfyui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Access your Pi-hole admin interface (typically http://pi.hole/admin)&lt;/li&gt;&lt;li&gt;Go to &amp;quot;Local DNS&amp;quot; → &amp;quot;DNS Records&amp;quot;&lt;/li&gt;&lt;li&gt;Add a new record:&lt;ul&gt;&lt;li&gt;Domain: comfyui.local (or your preferred name)&lt;/li&gt;&lt;li&gt;IP Address: Your computer&amp;#39;s IP address&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Save the record&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;This lets you access ComfyUI using the domain name you specified (e.g., http://comfyui.local:8188) from any device on your network.&lt;/p&gt;&lt;h3 id=&quot;72-configure-pi-hole-with-nginx-proxy-manager-if-using-both&quot;&gt;7.2 Configure Pi-hole with Nginx Proxy Manager (If Using Both)&lt;a class=&quot;h-anchor&quot; href=&quot;#72-configure-pi-hole-with-nginx-proxy-manager-if-using-both&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you&amp;#39;re using both Pi-hole and Nginx Proxy Manager, they might conflict because both want to use port 80. Here are some options:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Change Pi-hole&amp;#39;s web port:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;Edit the lighttpd configuration: &lt;code&gt;sudo nano /etc/lighttpd/lighttpd.conf&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Find the line with &lt;code&gt;server.port = 80&lt;/code&gt; and change it to another port (e.g., &lt;code&gt;server.port = 8080&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;Restart lighttpd: &lt;code&gt;sudo systemctl restart lighttpd&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Use Nginx Proxy Manager to proxy Pi-hole as well:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;In Nginx Proxy Manager, add another proxy host for Pi-hole&lt;/li&gt;&lt;li&gt;Set it to forward to Pi-hole&amp;#39;s IP address on port 80&lt;/li&gt;&lt;li&gt;Access Pi-hole through this proxy host instead of directly&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;8-known-issues-and-troubleshooting&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Known Issues and Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#8-known-issues-and-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;81-cudagpu-memory-issues&quot;&gt;8.1 CUDA/GPU Memory Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#81-cudagpu-memory-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If ComfyUI crashes with &amp;quot;CUDA out of memory&amp;quot; errors or your images fail to generate:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl edit comfyui.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following lines between the `````` markers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Service]
ExecStart=/home/YOUR_USERNAME/ComfyUI/venv/bin/python main.py --listen 0.0.0.0 --port 8188 --lowvram
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace YOUR_USERNAME with your actual username.&lt;/p&gt;&lt;p&gt;Save (Ctrl+X, Y, Enter) and then restart the service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Enables low VRAM mode, which uses less GPU memory but might be slightly slower.&lt;/p&gt;&lt;p&gt;For extremely limited VRAM, you can use &lt;code&gt;--medvram&lt;/code&gt; or both flags together: &lt;code&gt;--lowvram --medvram&lt;/code&gt;&lt;/p&gt;&lt;h3 id=&quot;82-amd-gpu-driver-issues&quot;&gt;8.2 AMD GPU Driver Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#82-amd-gpu-driver-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some AMD GPUs (especially newer models) might not work properly with the standard settings. If you see errors when running ComfyUI, you might need to override the graphics version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl edit comfyui.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following between the `````` markers:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Service]
Environment=&amp;quot;HSA_OVERRIDE_GFX_VERSION=10.3.0&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For RDNA3 cards like the 7600, use this instead:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Service]
Environment=&amp;quot;HSA_OVERRIDE_GFX_VERSION=11.0.0&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Save and restart:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;83-service-not-starting&quot;&gt;8.3 Service Not Starting&lt;a class=&quot;h-anchor&quot; href=&quot;#83-service-not-starting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If ComfyUI doesn&amp;#39;t start, check the logs for errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo journalctl -u comfyui -e
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Common issues include:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Incorrect paths in the service file&lt;/li&gt;&lt;li&gt;Virtual environment not set up correctly&lt;/li&gt;&lt;li&gt;Missing dependencies&lt;/li&gt;&lt;li&gt;GPU driver issues&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;84-port-already-in-use&quot;&gt;8.4 Port Already in Use&lt;a class=&quot;h-anchor&quot; href=&quot;#84-port-already-in-use&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you need to change the port after setting up the service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl edit comfyui.service
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;[Service]
ExecStart=/home/YOUR_USERNAME/ComfyUI/venv/bin/python main.py --listen 0.0.0.0 --port 8189
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace 8189 with your desired port number. Save and restart:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;9-maintenance-and-updates&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Maintenance and Updates&lt;a class=&quot;h-anchor&quot; href=&quot;#9-maintenance-and-updates&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;91-updating-comfyui&quot;&gt;9.1 Updating ComfyUI&lt;a class=&quot;h-anchor&quot; href=&quot;#91-updating-comfyui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To update ComfyUI to the latest version:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cd ~/ComfyUI
sudo systemctl stop comfyui
git pull
source venv/bin/activate
pip install -r requirements.txt
sudo systemctl start comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Stops the ComfyUI service&lt;/li&gt;&lt;li&gt;Downloads the latest code&lt;/li&gt;&lt;li&gt;Updates any dependencies&lt;/li&gt;&lt;li&gt;Restarts the service&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;92-updating-gpu-drivers&quot;&gt;9.2 Updating GPU Drivers&lt;a class=&quot;h-anchor&quot; href=&quot;#92-updating-gpu-drivers&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For both NVIDIA and AMD, the simplest way to update drivers is:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt upgrade -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This will update your drivers along with other system packages.&lt;/p&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully functioning ComfyUI installation on your Ubuntu system! You can access it directly through your web browser at http://localhost:8188 (or your custom domain if configured).&lt;/p&gt;&lt;p&gt;If you make any changes to the configuration, remember to restart the service using:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart comfyui
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Enjoy creating amazing AI-generated images with ComfyUI!&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Comprehensive Guide to Deploying Open WebUI with Ollama Using Docker Compose</title><link>https://diylabhub.com/comprehensive-guide-to-deploying-open-webui-with-ollama-using-docker-compose/</link><guid isPermaLink="true">https://diylabhub.com/comprehensive-guide-to-deploying-open-webui-with-ollama-using-docker-compose/</guid><pubDate>Sat, 08 Mar 2025 04:31:10 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Open WebUI is an extensible, feature-rich web interface for interacting with large language models that runs entirely offline. It provides a ChatGPT-like experience for models running through Ollama, an open-source framework designed for running LLMs locally. This guide covers multiple deployment configurations using Docker Compose, from basic setups to advanced scenarios with GPU support, enhanced security, and specialized integrations.&lt;/p&gt;&lt;h2 id=&quot;key-benefits&quot;&gt;Key Benefits&lt;a class=&quot;h-anchor&quot; href=&quot;#key-benefits&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Complete Privacy&lt;/strong&gt;: All data remains locally stored with no external requests&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Administrative Control&lt;/strong&gt;: The first account created automatically receives administrator privileges&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Model Privacy&lt;/strong&gt;: All models are private by default unless explicitly shared&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Simplified Deployment&lt;/strong&gt;: Docker Compose handles container orchestration, networking, and volume management&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before proceeding with any deployment, ensure your system meets these requirements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Docker Engine and Docker Compose&lt;/strong&gt; installed (verify with &lt;code&gt;docker --version&lt;/code&gt; and &lt;code&gt;docker-compose --version&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;For &lt;strong&gt;NVIDIA GPU support&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;Compatible NVIDIA drivers installed&lt;/li&gt;&lt;li&gt;NVIDIA Container Toolkit configured (verify with &lt;code&gt;nvidia-smi&lt;/code&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;For &lt;strong&gt;AMD GPU support&lt;/strong&gt;:&lt;ul&gt;&lt;li&gt;ROCm drivers installed and configured for container usage&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;recommended-system-requirements&quot;&gt;Recommended System Requirements&lt;a class=&quot;h-anchor&quot; href=&quot;#recommended-system-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Modern CPU with at least 4 cores&lt;/li&gt;&lt;li&gt;16GB or more of RAM&lt;/li&gt;&lt;li&gt;NVIDIA GPU with 8GB+ VRAM (for larger models)&lt;/li&gt;&lt;li&gt;SSD storage for faster model loading&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;basic-installation-with-docker-compose&quot;&gt;Basic Installation with Docker Compose&lt;a class=&quot;h-anchor&quot; href=&quot;#basic-installation-with-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This configuration provides a quick start with minimal setup while delivering a fully functional environment.&lt;/p&gt;&lt;h3 id=&quot;step-1-create-a-project-directory&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create a Project Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#step-1-create-a-project-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir open-webui-ollama
cd open-webui-ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-2-create-the-docker-compose-file&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Create the Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#step-2-create-the-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a file named &lt;code&gt;docker-compose.yml&lt;/code&gt; with the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    ports:
      - &amp;quot;11434:11434&amp;quot;
    volumes:
      - ollama_data:/root/.ollama
    restart: unless-stopped

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-3-deploy-the-services&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Deploy the Services&lt;a class=&quot;h-anchor&quot; href=&quot;#step-3-deploy-the-services&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;step-4-access-the-interface&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;Step 4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;: &lt;/span&gt;Access the Interface&lt;a class=&quot;h-anchor&quot; href=&quot;#step-4-access-the-interface&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your web browser and navigate to &lt;code&gt;http://localhost:3000&lt;/code&gt;. Create an account when prompted - the first account will automatically receive administrator privileges.&lt;/p&gt;&lt;h3 id=&quot;what-could-go-wrong&quot;&gt;What Could Go Wrong?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-could-go-wrong&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Port Conflicts&lt;/strong&gt;: If ports 3000 or 11434 are already in use, you&amp;#39;ll see errors. Change the left side of the port mapping (e.g., &lt;code&gt;&amp;quot;3001:8080&amp;quot;&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Memory Issues&lt;/strong&gt;: If your system has limited RAM, larger models may fail to load. Consider using smaller models or increasing your system&amp;#39;s memory&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Docker Network Issues&lt;/strong&gt;: If containers can&amp;#39;t communicate, check if Docker&amp;#39;s bridge network is functioning properly&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;advanced-docker-compose-configurations&quot;&gt;Advanced Docker Compose Configurations&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-docker-compose-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configuration-with-nvidia-gpu-support&quot;&gt;Configuration with NVIDIA GPU Support&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-nvidia-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For users with NVIDIA GPUs, this configuration enables hardware acceleration for significantly improved performance:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    ports:
      - &amp;quot;11434:11434&amp;quot;
    volumes:
      - ollama_data:/root/.ollama
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]
    restart: unless-stopped
    environment:
      - OLLAMA_HOST=0.0.0.0:11434

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
    depends_on:
      - ollama
    restart: unless-stopped
    extra_hosts:
      - &amp;quot;host.docker.internal:host-gateway&amp;quot;

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-with-amd-gpu-support&quot;&gt;Configuration with AMD GPU Support&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-amd-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For AMD GPU users, use this specialized configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    image: ollama/ollama:rocm
    container_name: ollama
    ports:
      - &amp;quot;11434:11434&amp;quot;
    volumes:
      - ollama_data:/root/.ollama
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]
    restart: unless-stopped
    environment:
      - HSA_OVERRIDE_GFX_VERSION=x.x.x  # Replace with your GPU&amp;#39;s GFX version
      - OLLAMA_HOST=0.0.0.0:11434

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;x.x.x&lt;/code&gt; with your specific AMD GPU&amp;#39;s GFX version. You can find this information by running &lt;code&gt;rocminfo&lt;/code&gt; and looking for the &amp;quot;gfx&amp;quot; value.&lt;/p&gt;&lt;h3 id=&quot;what-could-go-wrong-with-gpu-configurations&quot;&gt;What Could Go Wrong with GPU Configurations?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-could-go-wrong-with-gpu-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Driver Compatibility&lt;/strong&gt;: Ensure your GPU drivers are compatible with the container runtime&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Missing NVIDIA Container Toolkit&lt;/strong&gt;: For NVIDIA GPUs, this must be properly installed&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ROCm Compatibility&lt;/strong&gt;: Not all AMD GPUs are supported by ROCm; check compatibility before deployment&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Resource Allocation&lt;/strong&gt;: If multiple applications are using the GPU, performance may be affected&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;specialized-network-configurations&quot;&gt;Specialized Network Configurations&lt;a class=&quot;h-anchor&quot; href=&quot;#specialized-network-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configuration-for-ollama-running-on-host-outside-docker&quot;&gt;Configuration for Ollama Running on Host (Outside Docker)&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-for-ollama-running-on-host-outside-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Ollama is installed directly on your system rather than in Docker:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=http://host.docker.internal:11434
    extra_hosts:
      - &amp;quot;host.docker.internal:host-gateway&amp;quot;
    restart: unless-stopped

volumes:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-for-ollama-on-a-remote-server&quot;&gt;Configuration for Ollama on a Remote Server&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-for-ollama-on-a-remote-server&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Ollama is running on a different machine:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=https://your-ollama-server:11434
    restart: unless-stopped

volumes:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;https://your-ollama-server:11434&lt;/code&gt; with the actual URL of your remote Ollama server.&lt;/p&gt;&lt;h3 id=&quot;configuration-with-bundled-ollama&quot;&gt;Configuration with Bundled Ollama&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-bundled-ollama&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open WebUI offers a version with Ollama bundled into the same image for simplified deployment:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:ollama
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - ollama:/root/.ollama
      - open-webui:/app/backend/data
    restart: unless-stopped

volumes:
  ollama:
  open-webui:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For GPU support with this bundled version, add the deploy section as shown in the GPU configurations.&lt;/p&gt;&lt;h3 id=&quot;what-could-go-wrong-with-network-configurations&quot;&gt;What Could Go Wrong with Network Configurations?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-could-go-wrong-with-network-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Firewall Issues&lt;/strong&gt;: Ensure the Ollama server allows incoming connections on port 11434&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SSL Certificate Problems&lt;/strong&gt;: If using HTTPS, ensure certificates are valid&lt;/li&gt;&lt;li&gt;&lt;strong&gt;DNS Resolution&lt;/strong&gt;: The &lt;code&gt;host.docker.internal&lt;/code&gt; hostname might not work in all Docker environments&lt;/li&gt;&lt;li&gt;&lt;strong&gt;API Version Mismatch&lt;/strong&gt;: Ensure Open WebUI and Ollama versions are compatible&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;enhanced-security-configurations&quot;&gt;Enhanced Security Configurations&lt;a class=&quot;h-anchor&quot; href=&quot;#enhanced-security-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configuration-with-enhanced-security&quot;&gt;Configuration with Enhanced Security&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-enhanced-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add security-related environment variables for better protection:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    # Ollama configuration as in basic setup

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
      - WEBUI_SECRET_KEY=your_secret_key  # Generate with: openssl rand -hex 32
      - WEBUI_JWT_SECRET_KEY=your_jwt_secret  # Generate with: openssl rand -hex 32
      - WEBUI_AUTH_ENABLED=true  # Enforce authentication
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Generate secure keys using:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;openssl rand -hex 32
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-with-searxng-integration-for-rag&quot;&gt;Configuration with SearXNG Integration for RAG&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-searxng-integration-for-rag&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For users interested in Retrieval-Augmented Generation (RAG) capabilities:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    # Ollama configuration as in basic setup

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
      - WEBUI_SECRET_KEY=your_secret_key
      - SEARXNG_BASE_URL=http://searxng:8080
    depends_on:
      - ollama
      - searxng
    restart: unless-stopped

  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - &amp;quot;8080:8080&amp;quot;
    environment:
      - SEARXNG_SECRET=your_searxng_secret  # Generate with: openssl rand -hex 32
    restart: unless-stopped

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-with-openai-api-integration&quot;&gt;Configuration with OpenAI API Integration&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-openai-api-integration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you want to use Open WebUI with OpenAI&amp;#39;s API:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    environment:
      - OPENAI_API_KEY=your_openai_api_key
    restart: unless-stopped

volumes:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your_openai_api_key&lt;/code&gt; with your actual OpenAI API key.&lt;/p&gt;&lt;h3 id=&quot;what-could-go-wrong-with-enhanced-security&quot;&gt;What Could Go Wrong with Enhanced Security?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-could-go-wrong-with-enhanced-security&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Secret Key Issues&lt;/strong&gt;: If the secret key changes, existing sessions will be invalidated&lt;/li&gt;&lt;li&gt;&lt;strong&gt;JWT Authentication&lt;/strong&gt;: If misconfigured, users may be unable to log in&lt;/li&gt;&lt;li&gt;&lt;strong&gt;SearXNG Integration&lt;/strong&gt;: If SearXNG is unreachable, RAG functionality will not work&lt;/li&gt;&lt;li&gt;&lt;strong&gt;API Key Exposure&lt;/strong&gt;: Storing API keys in Docker Compose files poses a security risk; consider using Docker secrets or environment variables from a secure source&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;production-deployment-configurations&quot;&gt;Production Deployment Configurations&lt;a class=&quot;h-anchor&quot; href=&quot;#production-deployment-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configuration-with-traefik-reverse-proxy&quot;&gt;Configuration with Traefik Reverse Proxy&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-traefik-reverse-proxy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For production deployments with domain name support and SSL certificates:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - &amp;quot;80:80&amp;quot;
      - &amp;quot;443:443&amp;quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro
      - ./traefik/acme.json:/acme.json
    networks:
      - traefik-network
    restart: unless-stopped

  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    volumes:
      - ollama_data:/root/.ollama
    networks:
      - ollama-network
      - traefik-network
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]
    restart: unless-stopped

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    volumes:
      - open-webui_data:/app/backend/data
    networks:
      - ollama-network
      - traefik-network
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
    labels:
      - &amp;quot;traefik.enable=true&amp;quot;
      - &amp;quot;traefik.http.routers.openwebui.rule=Host(`your-domain.com`)&amp;quot;
      - &amp;quot;traefik.http.routers.openwebui.entrypoints=websecure&amp;quot;
      - &amp;quot;traefik.http.routers.openwebui.tls.certresolver=letsencrypt&amp;quot;
      - &amp;quot;traefik.http.services.openwebui.loadbalancer.server.port=8080&amp;quot;
    depends_on:
      - ollama
    restart: unless-stopped

networks:
  traefik-network:
    external: true
  ollama-network:
    external: true

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Before deploying, create the necessary networks:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;docker network create traefik-network
docker network create ollama-network
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;And create a basic Traefik configuration file at &lt;code&gt;./traefik/traefik.yml&lt;/code&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;entryPoints:
  web:
    address: &amp;quot;:80&amp;quot;
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure:
    address: &amp;quot;:443&amp;quot;

certificatesResolvers:
  letsencrypt:
    acme:
      email: your-email@example.com
      storage: acme.json
      httpChallenge:
        entryPoint: web

providers:
  docker:
    exposedByDefault: false
    network: traefik-network
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Also, create an empty acme.json file and set proper permissions:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;touch ./traefik/acme.json
chmod 600 ./traefik/acme.json
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-with-cloudflare-tunnel&quot;&gt;Configuration with Cloudflare Tunnel&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-cloudflare-tunnel&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For secure remote access without exposing your server directly to the internet:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    # Ollama configuration as in basic or GPU setup

  open-webui:
    # Open WebUI configuration as above

  tunnel:
    image: cloudflare/cloudflared:latest
    container_name: cloudflare-tunnel
    command: tunnel --no-autoupdate run
    environment:
      - TUNNEL_TOKEN=your_cloudflare_tunnel_token
    restart: unless-stopped
    depends_on:
      - open-webui
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Replace &lt;code&gt;your_cloudflare_tunnel_token&lt;/code&gt; with the token generated from your Cloudflare account.&lt;/p&gt;&lt;h3 id=&quot;what-could-go-wrong-with-production-configurations&quot;&gt;What Could Go Wrong with Production Configurations?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-could-go-wrong-with-production-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Certificate Issuance&lt;/strong&gt;: Let&amp;#39;s Encrypt has rate limits that may be hit during testing&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Domain Configuration&lt;/strong&gt;: DNS must be properly configured to point to your server&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Traefik Configuration&lt;/strong&gt;: Syntax errors in traefik.yml may prevent the service from starting&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Network Isolation&lt;/strong&gt;: Ensure services are on the correct networks to communicate properly&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cloudflare Token&lt;/strong&gt;: If expired or revoked, the tunnel will stop working&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;service-management-and-maintenance&quot;&gt;Service Management and Maintenance&lt;a class=&quot;h-anchor&quot; href=&quot;#service-management-and-maintenance&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;starting-and-stopping-services&quot;&gt;Starting and Stopping Services&lt;a class=&quot;h-anchor&quot; href=&quot;#starting-and-stopping-services&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To start your services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To stop services while preserving volumes:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose down
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To completely remove everything including volumes:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose down -v
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;viewing-logs&quot;&gt;Viewing Logs&lt;a class=&quot;h-anchor&quot; href=&quot;#viewing-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To view logs of all services:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose logs -f
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For a specific service:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose logs -f open-webui
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;updating-services&quot;&gt;Updating Services&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-services&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Pull the latest images and restart:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose pull
docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;backing-up-data&quot;&gt;Backing Up Data&lt;a class=&quot;h-anchor&quot; href=&quot;#backing-up-data&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Back up the Docker volumes:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm -v ollama_data:/data -v $(pwd):/backup alpine tar czf /backup/ollama_backup.tar.gz -C /data .
docker run --rm -v open-webui_data:/data -v $(pwd):/backup alpine tar czf /backup/open-webui_backup.tar.gz -C /data .
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;To restore from backups:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run --rm -v ollama_data:/data -v $(pwd):/backup alpine sh -c &amp;quot;rm -rf /data/* &amp;amp;&amp;amp; tar xzf /backup/ollama_backup.tar.gz -C /data&amp;quot;
docker run --rm -v open-webui_data:/data -v $(pwd):/backup alpine sh -c &amp;quot;rm -rf /data/* &amp;amp;&amp;amp; tar xzf /backup/open-webui_backup.tar.gz -C /data&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;what-could-go-wrong-with-maintenance&quot;&gt;What Could Go Wrong with Maintenance?&lt;a class=&quot;h-anchor&quot; href=&quot;#what-could-go-wrong-with-maintenance&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Disk Space&lt;/strong&gt;: Ensuring sufficient disk space before updates and backups is crucial&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Inconsistent State&lt;/strong&gt;: Stopping services unexpectedly may lead to data corruption&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Version Incompatibility&lt;/strong&gt;: New versions might have breaking changes requiring configuration updates&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Backup Failures&lt;/strong&gt;: Always verify backups are complete and restorable&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;gpu-not-detected&quot;&gt;GPU Not Detected&lt;a class=&quot;h-anchor&quot; href=&quot;#gpu-not-detected&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Verify GPU Drivers&lt;/strong&gt;: &lt;code&gt;# For NVIDIA nvidia-smi # For AMD rocm-smi&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Check Container Toolkit&lt;/strong&gt;: &lt;code&gt;# For NVIDIA sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Verify Docker Compose Configuration&lt;/strong&gt;: Ensure the &lt;code&gt;deploy&lt;/code&gt; section is correctly formatted.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;connection-issues-between-open-webui-and-ollama&quot;&gt;Connection Issues Between Open WebUI and Ollama&lt;a class=&quot;h-anchor&quot; href=&quot;#connection-issues-between-open-webui-and-ollama&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Check Network Configuration&lt;/strong&gt;: Ensure the OLLAMA_API_BASE_URL is correctly set.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Test Connection&lt;/strong&gt;: &lt;code&gt;docker exec open-webui curl -s http://ollama:11434/api/version&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Check Firewall Rules&lt;/strong&gt;: If using different servers, ensure ports are open.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;performance-issues&quot;&gt;Performance Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#performance-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Check System Resources&lt;/strong&gt;: &lt;code&gt;# CPU and memory usage htop # GPU usage nvidia-smi -l 1&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Use a Smaller Model&lt;/strong&gt;: If resources are limited, try models that require less memory.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Adjust Concurrent Requests&lt;/strong&gt;: In Open WebUI settings, lower the number of concurrent requests.&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;model-loading-failures&quot;&gt;Model Loading Failures&lt;a class=&quot;h-anchor&quot; href=&quot;#model-loading-failures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Check Disk Space&lt;/strong&gt;: &lt;code&gt;df -h&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Manually Pull Models&lt;/strong&gt;: &lt;code&gt;docker exec -it ollama ollama pull model_name&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Check Ollama Logs&lt;/strong&gt;: &lt;code&gt;docker-compose logs -f ollama&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;environmental-variables-reference&quot;&gt;Environmental Variables Reference&lt;a class=&quot;h-anchor&quot; href=&quot;#environmental-variables-reference&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;open-webui-environment-variables&quot;&gt;Open WebUI Environment Variables&lt;a class=&quot;h-anchor&quot; href=&quot;#open-webui-environment-variables&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Variable&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Default&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;OLLAMA_API_BASE_URL&lt;/code&gt;&lt;/td&gt;&lt;td&gt;URL to the Ollama API&lt;/td&gt;&lt;td&gt;&lt;code&gt;http://ollama:11434&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;WEBUI_SECRET_KEY&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Secret key for encryption&lt;/td&gt;&lt;td&gt;Random generated&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;WEBUI_JWT_SECRET_KEY&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Secret for JWT tokens&lt;/td&gt;&lt;td&gt;Random generated&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;WEBUI_AUTH_ENABLED&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Enable authentication&lt;/td&gt;&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;WEBUI_ALLOW_REGISTRATION&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Allow new user registration&lt;/td&gt;&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;SEARXNG_BASE_URL&lt;/code&gt;&lt;/td&gt;&lt;td&gt;URL to SearXNG for RAG&lt;/td&gt;&lt;td&gt;None&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;OPENAI_API_KEY&lt;/code&gt;&lt;/td&gt;&lt;td&gt;OpenAI API key&lt;/td&gt;&lt;td&gt;None&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;WEBUI_SERVE_PORT&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Port to serve the UI&lt;/td&gt;&lt;td&gt;&lt;code&gt;8080&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;WEBUI_MAX_UPLOAD_SIZE&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Max file upload size&lt;/td&gt;&lt;td&gt;&lt;code&gt;100&lt;/code&gt; (MB)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h3 id=&quot;ollama-environment-variables&quot;&gt;Ollama Environment Variables&lt;a class=&quot;h-anchor&quot; href=&quot;#ollama-environment-variables&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Variable&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Default&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;OLLAMA_HOST&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Host and port to bind Ollama&lt;/td&gt;&lt;td&gt;&lt;code&gt;0.0.0.0:11434&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;OLLAMA_MODELS&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Models to pull at startup&lt;/td&gt;&lt;td&gt;None&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;OLLAMA_DEBUG&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Enable debug logging&lt;/td&gt;&lt;td&gt;None&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;OLLAMA_NUM_GPU&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Number of GPUs to use&lt;/td&gt;&lt;td&gt;All available&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2 id=&quot;advanced-configuration-examples&quot;&gt;Advanced Configuration Examples&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-configuration-examples&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;configuration-with-multiple-models-loaded-at-startup&quot;&gt;Configuration with Multiple Models Loaded at Startup&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-multiple-models-loaded-at-startup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    ports:
      - &amp;quot;11434:11434&amp;quot;
    volumes:
      - ollama_data:/root/.ollama
    environment:
      - OLLAMA_HOST=0.0.0.0:11434
      - OLLAMA_MODELS=llama3,phi3,gemma
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]
    restart: unless-stopped

  open-webui:
    # Standard Open WebUI configuration

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-with-resource-limits&quot;&gt;Configuration with Resource Limits&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-resource-limits&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    ports:
      - &amp;quot;11434:11434&amp;quot;
    volumes:
      - ollama_data:/root/.ollama
    deploy:
      resources:
        limits:
          cpus: &amp;#39;4&amp;#39;
          memory: 16G
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]
              count: 1  # Use only one GPU if multiple are available
    restart: unless-stopped

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    ports:
      - &amp;quot;3000:8080&amp;quot;
    volumes:
      - open-webui_data:/app/backend/data
    deploy:
      resources:
        limits:
          cpus: &amp;#39;1&amp;#39;
          memory: 2G
    environment:
      - OLLAMA_API_BASE_URL=http://ollama:11434
    depends_on:
      - ollama
    restart: unless-stopped

volumes:
  ollama_data:
  open-webui_data:
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;configuration-with-persistent-cache-directory&quot;&gt;Configuration with Persistent Cache Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-with-persistent-cache-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This helps speed up repeated model loading:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    ports:
      - &amp;quot;11434:11434&amp;quot;
    volumes:
      - ollama_data:/root/.ollama
      - ollama_cache:/tmp/ollama_cache
    environment:
      - OLLAMA_HOST=0.0.0.0:11434
      - XDG_CACHE_HOME=/tmp/ollama_cache
    restart: unless-stopped

  open-webui:
    # Standard Open WebUI configuration

volumes:
  ollama_data:
  open-webui_data:
  ollama_cache:
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This comprehensive guide covers most deployment scenarios for Open WebUI with Ollama using Docker Compose. By following these configurations and best practices, you can create a robust and secure deployment tailored to your specific requirements.&lt;/p&gt;&lt;p&gt;Remember that the performance of local language models depends significantly on your hardware capabilities. Regular maintenance, including updates and backups, ensures your deployment remains secure and benefits from the latest improvements to both Open WebUI and Ollama.&lt;/p&gt;&lt;p&gt;As these technologies continue to evolve, these configurations may need adjustments to accommodate new features and capabilities. Stay informed about updates to both projects and adapt your configurations accordingly.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Installing and Using Ollama</title><link>https://diylabhub.com/complete-guide-to-installing-and-using-ollama/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-using-ollama/</guid><pubDate>Sat, 08 Mar 2025 03:28:21 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ollama is a lightweight tool that lets you run large language models (LLMs) locally on your own machine. This means you can access powerful AI capabilities without sending your data to third-party services. Ollama makes it easy to download, manage, and run various open-source models like Llama, Mistral, and many others directly on your computer.&lt;/p&gt;&lt;p&gt;Running models locally with Ollama offers several benefits:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Privacy: Your data stays on your machine&lt;/li&gt;&lt;li&gt;No internet required after initial model download&lt;/li&gt;&lt;li&gt;Free to use (though you need sufficient hardware)&lt;/li&gt;&lt;li&gt;Customizable experience&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before installing Ollama, make sure your system meets these requirements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: macOS, Windows, or Linux&lt;/li&gt;&lt;li&gt;&lt;strong&gt;RAM&lt;/strong&gt;: At least 8GB (16GB+ recommended for better performance)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Storage&lt;/strong&gt;: At least 10GB of free space (more for multiple models)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;CPU&lt;/strong&gt;: 64-bit processor (some models may require AVX2 instructions)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GPU&lt;/strong&gt;: Optional but recommended for better performance&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;installation-process&quot;&gt;Installation Process&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-process&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;macos-installation&quot;&gt;macOS Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#macos-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://ollama.com/install.sh | sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads and runs the Ollama installation script. Ollama will be installed as an application.&lt;/p&gt;&lt;p&gt;If the command fails, check your internet connection or try downloading the installer directly from the Ollama website.&lt;/p&gt;&lt;h3 id=&quot;windows-installation&quot;&gt;Windows Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#windows-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;winget install Ollama.Ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This uses Windows Package Manager to install Ollama. Alternatively, you can download the installer from the Ollama website.&lt;/p&gt;&lt;p&gt;If you get a &amp;quot;not found&amp;quot; error, make sure you have winget installed or download the .msi installer from the Ollama website.&lt;/p&gt;&lt;h3 id=&quot;linux-installation&quot;&gt;Linux Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#linux-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -fsSL https://ollama.com/install.sh | sh
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads and runs the Ollama installation script, installing Ollama on your Linux system.&lt;/p&gt;&lt;p&gt;If you encounter permission issues, you might need to run the command with sudo.&lt;/p&gt;&lt;h2 id=&quot;running-ollama&quot;&gt;Running Ollama&lt;a class=&quot;h-anchor&quot; href=&quot;#running-ollama&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After installation, Ollama starts automatically as a service. You can interact with it through the command line.&lt;/p&gt;&lt;h3 id=&quot;starting-ollama-if-not-already-running&quot;&gt;Starting Ollama (if not already running)&lt;a class=&quot;h-anchor&quot; href=&quot;#starting-ollama-if-not-already-running&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama serve
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts the Ollama service if it&amp;#39;s not already running. Keep this terminal window open while using Ollama.&lt;/p&gt;&lt;p&gt;If you see &amp;quot;address already in use&amp;quot; errors, Ollama is likely already running.&lt;/p&gt;&lt;h2 id=&quot;default-model-directories&quot;&gt;Default Model Directories&lt;a class=&quot;h-anchor&quot; href=&quot;#default-model-directories&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ollama stores models in the following default locations:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;macOS&lt;/strong&gt;: &lt;code&gt;~/.ollama/models&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Linux&lt;/strong&gt;: &lt;code&gt;~/.ollama/models&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Windows&lt;/strong&gt;: &lt;code&gt;C:\Users\&amp;lt;username&amp;gt;\.ollama\models&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These directories are created automatically during installation.&lt;/p&gt;&lt;h2 id=&quot;managing-models-with-ollama&quot;&gt;Managing Models with Ollama&lt;a class=&quot;h-anchor&quot; href=&quot;#managing-models-with-ollama&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;pulling-your-first-model&quot;&gt;Pulling Your First Model&lt;a class=&quot;h-anchor&quot; href=&quot;#pulling-your-first-model&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama pull mistral
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This downloads the Mistral model, a good general-purpose model that balances performance and resource usage.&lt;/p&gt;&lt;p&gt;Depending on your internet connection, this might take several minutes. The command will show download progress.&lt;/p&gt;&lt;h3 id=&quot;pulling-latest-models&quot;&gt;Pulling Latest Models&lt;a class=&quot;h-anchor&quot; href=&quot;#pulling-latest-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama pull llama3.2:8b
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls the 8 billion parameter version of Llama 3.2, one of the newer models available.&lt;/p&gt;&lt;p&gt;Newer models like Llama 3.2 often provide improved capabilities but may require more resources.&lt;/p&gt;&lt;h3 id=&quot;listing-available-models&quot;&gt;Listing Available Models&lt;a class=&quot;h-anchor&quot; href=&quot;#listing-available-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama list
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows all models currently downloaded on your system.&lt;/p&gt;&lt;p&gt;If no models appear but you&amp;#39;ve downloaded some, check if the Ollama service is running.&lt;/p&gt;&lt;h3 id=&quot;running-a-model&quot;&gt;Running a Model&lt;a class=&quot;h-anchor&quot; href=&quot;#running-a-model&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama run mistral
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This starts a chat session with the Mistral model in your terminal.&lt;/p&gt;&lt;p&gt;If you see errors about the model not being found, make sure you&amp;#39;ve pulled it first.&lt;/p&gt;&lt;h2 id=&quot;gpu-configuration&quot;&gt;GPU Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#gpu-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;setting-up-nvidia-gpu-support&quot;&gt;Setting Up NVIDIA GPU Support&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-nvidia-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For NVIDIA GPUs, ensure you have the appropriate drivers and CUDA installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check CUDA installation
nvidia-smi
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This displays your GPU information and CUDA version. Ollama works best with CUDA 11.4+.&lt;/p&gt;&lt;p&gt;If the command isn&amp;#39;t found, install NVIDIA drivers and CUDA toolkit first.&lt;/p&gt;&lt;h3 id=&quot;configuring-gpu-memory-allocation&quot;&gt;Configuring GPU Memory Allocation&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-gpu-memory-allocation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;CUDA_VISIBLE_DEVICES=0 ollama run llama3:8b --gpu-layers 35
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This runs the model on GPU 0 and specifies loading 35 layers onto the GPU.&lt;/p&gt;&lt;p&gt;Adjust the number of GPU layers based on your available VRAM. More layers mean better performance but require more memory.&lt;/p&gt;&lt;h3 id=&quot;setting-up-amd-gpu-support&quot;&gt;Setting Up AMD GPU Support&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-amd-gpu-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For AMD GPUs, ensure ROCm is installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Check ROCm installation
rocminfo
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This verifies ROCm is properly installed. AMD support is more limited than NVIDIA.&lt;/p&gt;&lt;p&gt;If your AMD GPU isn&amp;#39;t detected, ensure you have compatible drivers and ROCm version installed.&lt;/p&gt;&lt;h3 id=&quot;intel-gpu-configuration&quot;&gt;Intel GPU Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#intel-gpu-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For Intel Arc GPUs:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ONEAPI_DEVICE_SELECTOR=level_zero:0 ollama run mistral --gpu-layers 32
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This enables Intel Arc GPU acceleration through OneAPI.&lt;/p&gt;&lt;p&gt;Intel GPU support is newer and may have limitations compared to NVIDIA support.&lt;/p&gt;&lt;h2 id=&quot;organizing-models&quot;&gt;Organizing Models&lt;a class=&quot;h-anchor&quot; href=&quot;#organizing-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;creating-a-custom-model-directory&quot;&gt;Creating a Custom Model Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-a-custom-model-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;By default, Ollama stores models in its data directory. To use a custom location:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p ~/ollama-models
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a directory for organizing your models.&lt;/p&gt;&lt;p&gt;The directory won&amp;#39;t be used by Ollama automatically; we&amp;#39;ll need to configure it.&lt;/p&gt;&lt;h3 id=&quot;configuring-custom-model-directory&quot;&gt;Configuring Custom Model Directory&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-custom-model-directory&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For Linux/macOS:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;export OLLAMA_MODELS=~/ollama-models
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For Windows (PowerShell):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;$env:OLLAMA_MODELS=&amp;quot;C:\path\to\ollama-models&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This tells Ollama where to store and look for models.&lt;/p&gt;&lt;p&gt;Note that this setting only applies to the current terminal session. Add it to your shell profile for persistence.&lt;/p&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;restricting-network-access&quot;&gt;Restricting Network Access&lt;a class=&quot;h-anchor&quot; href=&quot;#restricting-network-access&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;By default, Ollama only listens on localhost. To restrict access further:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;OLLAMA_HOST=127.0.0.1:11434 ollama serve
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures Ollama only accepts connections from the local machine.&lt;/p&gt;&lt;p&gt;Never expose Ollama to the public internet without proper security measures.&lt;/p&gt;&lt;h3 id=&quot;configuring-firewall-rules&quot;&gt;Configuring Firewall Rules&lt;a class=&quot;h-anchor&quot; href=&quot;#configuring-firewall-rules&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For Linux (using ufw):&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo ufw allow from 192.168.1.0/24 to any port 11434
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This allows only your local network to access Ollama.&lt;/p&gt;&lt;p&gt;Adjust the IP range to match your specific network configuration.&lt;/p&gt;&lt;h3 id=&quot;setting-up-basic-authentication&quot;&gt;Setting Up Basic Authentication&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-basic-authentication&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While Ollama doesn&amp;#39;t have built-in authentication, you can use a reverse proxy:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# Using nginx as a reverse proxy with basic auth
sudo apt install nginx apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd username
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Then configure nginx to proxy requests to Ollama with authentication.&lt;/p&gt;&lt;p&gt;This adds a layer of protection when exposing Ollama on a network.&lt;/p&gt;&lt;h2 id=&quot;advanced-model-management&quot;&gt;Advanced Model Management&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-model-management&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;removing-a-model&quot;&gt;Removing a Model&lt;a class=&quot;h-anchor&quot; href=&quot;#removing-a-model&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama rm mistral
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This removes the Mistral model from your system, freeing up disk space.&lt;/p&gt;&lt;p&gt;Make sure you&amp;#39;re not currently using the model when removing it.&lt;/p&gt;&lt;h3 id=&quot;pulling-a-specific-model-version&quot;&gt;Pulling a Specific Model Version&lt;a class=&quot;h-anchor&quot; href=&quot;#pulling-a-specific-model-version&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama pull llama2:7b
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This pulls a specific version of a model (in this case, the 7 billion parameter version of Llama 2).&lt;/p&gt;&lt;p&gt;Larger models provide better quality but require more resources.&lt;/p&gt;&lt;h3 id=&quot;pulling-models-from-hugging-face&quot;&gt;Pulling Models from Hugging Face&lt;a class=&quot;h-anchor&quot; href=&quot;#pulling-models-from-hugging-face&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Ollama supports importing models from Hugging Face using the Modelfile approach:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;FROM hf://huggingface/mistralai/Mistral-7B-v0.1&amp;quot; &amp;gt; Modelfile
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a Modelfile that references a Hugging Face model.&lt;/p&gt;&lt;p&gt;Make sure you have proper permissions to access the model if it&amp;#39;s not public.&lt;/p&gt;&lt;h3 id=&quot;creating-a-model-from-the-modelfile&quot;&gt;Creating a Model from the Modelfile&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-a-model-from-the-modelfile&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama create mistral-hf -f Modelfile
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a new model in Ollama based on the Hugging Face definition.&lt;/p&gt;&lt;p&gt;This process may take time as it downloads and converts the model.&lt;/p&gt;&lt;h2 id=&quot;using-ollama-with-different-interfaces&quot;&gt;Using Ollama With Different Interfaces&lt;a class=&quot;h-anchor&quot; href=&quot;#using-ollama-with-different-interfaces&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;using-the-web-ui&quot;&gt;Using the Web UI&lt;a class=&quot;h-anchor&quot; href=&quot;#using-the-web-ui&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While Ollama doesn&amp;#39;t include a web UI by default, you can install a compatible one:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;git clone https://github.com/ollama-webui/ollama-webui.git
cd ollama-webui
docker compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets up a user-friendly web interface for Ollama on http://localhost:3000.&lt;/p&gt;&lt;p&gt;Make sure Docker is installed on your system first.&lt;/p&gt;&lt;h3 id=&quot;using-ollama-api&quot;&gt;Using Ollama API&lt;a class=&quot;h-anchor&quot; href=&quot;#using-ollama-api&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Ollama also provides a REST API:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -X POST http://localhost:11434/api/generate -d &amp;#39;{
  &amp;quot;model&amp;quot;: &amp;quot;mistral&amp;quot;,
  &amp;quot;prompt&amp;quot;: &amp;quot;Why is the sky blue?&amp;quot;
}&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sends a prompt to Ollama&amp;#39;s API and returns the model&amp;#39;s response.&lt;/p&gt;&lt;p&gt;If you get connection errors, make sure the Ollama service is running.&lt;/p&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;model-wont-download&quot;&gt;Model Won&amp;#39;t Download&lt;a class=&quot;h-anchor&quot; href=&quot;#model-wont-download&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If a model fails to download:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama pull mistral --insecure
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This attempts to download using non-secure connections, which can help with certain network issues.&lt;/p&gt;&lt;p&gt;Only use this option if you trust the source.&lt;/p&gt;&lt;h3 id=&quot;out-of-memory-errors&quot;&gt;Out of Memory Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#out-of-memory-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you encounter out of memory errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama run mistral --compute=cpu
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This forces the model to run on CPU only, which uses less memory but runs slower.&lt;/p&gt;&lt;p&gt;Alternatively, try using smaller models like tinyllama or orca-mini.&lt;/p&gt;&lt;h3 id=&quot;permission-denied-errors&quot;&gt;Permission Denied Errors&lt;a class=&quot;h-anchor&quot; href=&quot;#permission-denied-errors&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For Linux users encountering permission issues:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo chown -R $(whoami) ~/.ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures you have proper ownership of the Ollama directories.&lt;/p&gt;&lt;p&gt;Be careful with sudo commands; only use when necessary.&lt;/p&gt;&lt;h3 id=&quot;gpu-not-detected&quot;&gt;GPU Not Detected&lt;a class=&quot;h-anchor&quot; href=&quot;#gpu-not-detected&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If your GPU is not being detected:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;# For NVIDIA
ollama run mistral --verbose
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This shows detailed logs that can help identify GPU-related issues.&lt;/p&gt;&lt;p&gt;Check driver compatibility and ensure your GPU has enough VRAM for the model.&lt;/p&gt;&lt;h2 id=&quot;known-bugs-and-workarounds&quot;&gt;Known Bugs and Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-bugs-and-workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;gpu-memory-leaks&quot;&gt;GPU Memory Leaks&lt;a class=&quot;h-anchor&quot; href=&quot;#gpu-memory-leaks&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some users report GPU memory not being released properly after using Ollama:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama serve --compute=cpu # then restart with GPU
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This runs Ollama in CPU-only mode temporarily, which can help reset GPU memory.&lt;/p&gt;&lt;p&gt;Restart Ollama completely if issues persist.&lt;/p&gt;&lt;h3 id=&quot;cli-freezing-on-windows&quot;&gt;CLI Freezing on Windows&lt;a class=&quot;h-anchor&quot; href=&quot;#cli-freezing-on-windows&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Some Windows users report the CLI freezing:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama run mistral --verbose
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Running with verbose output can help identify where issues occur.&lt;/p&gt;&lt;p&gt;The Windows version of Ollama is newer and may have more bugs than macOS/Linux versions.&lt;/p&gt;&lt;h3 id=&quot;model-loading-timeout&quot;&gt;Model Loading Timeout&lt;a class=&quot;h-anchor&quot; href=&quot;#model-loading-timeout&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For very large models that time out during loading:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;OLLAMA_TIMEOUT=600 ollama run llama3:70b
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This increases the timeout to 10 minutes (from the default 3 minutes).&lt;/p&gt;&lt;p&gt;Adjust the timeout value based on your system&amp;#39;s performance.&lt;/p&gt;&lt;h2 id=&quot;maintenance&quot;&gt;Maintenance&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;updating-ollama&quot;&gt;Updating Ollama&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-ollama&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama pull ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates the Ollama software to the latest version.&lt;/p&gt;&lt;p&gt;It&amp;#39;s recommended to update regularly for bug fixes and new features.&lt;/p&gt;&lt;h3 id=&quot;backing-up-your-models&quot;&gt;Backing Up Your Models&lt;a class=&quot;h-anchor&quot; href=&quot;#backing-up-your-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;tar -czf ollama-backup.tar.gz ~/.ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;For Linux/macOS, this creates a compressed backup of your Ollama data directory.&lt;/p&gt;&lt;p&gt;For Windows, consider using a backup tool like 7-Zip to compress the Ollama directory.&lt;/p&gt;&lt;h3 id=&quot;updating-models&quot;&gt;Updating Models&lt;a class=&quot;h-anchor&quot; href=&quot;#updating-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama pull mistral:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This updates a model to its latest version.&lt;/p&gt;&lt;p&gt;Note that this downloads the model again, so make sure you have enough disk space.&lt;/p&gt;&lt;h2 id=&quot;advanced-usage&quot;&gt;Advanced Usage&lt;a class=&quot;h-anchor&quot; href=&quot;#advanced-usage&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;creating-custom-models&quot;&gt;Creating Custom Models&lt;a class=&quot;h-anchor&quot; href=&quot;#creating-custom-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You can create custom models by extending existing ones:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo &amp;quot;FROM mistral
PARAMETER temperature 0.7
SYSTEM You are a helpful coding assistant.&amp;quot; &amp;gt; CustomModelfile
ollama create coder -f CustomModelfile
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This creates a custom model with specific parameters and system instructions.&lt;/p&gt;&lt;p&gt;Customizing models can help tailor them to specific tasks.&lt;/p&gt;&lt;h3 id=&quot;running-models-with-custom-parameters&quot;&gt;Running Models with Custom Parameters&lt;a class=&quot;h-anchor&quot; href=&quot;#running-models-with-custom-parameters&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama run mistral --temperature 0.2
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This runs the model with a lower temperature setting (more focused, less creative responses).&lt;/p&gt;&lt;p&gt;Different parameters can significantly change how the model responds.&lt;/p&gt;&lt;h3 id=&quot;exporting-models&quot;&gt;Exporting Models&lt;a class=&quot;h-anchor&quot; href=&quot;#exporting-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama export mistral &amp;gt; mistral-exported.ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This exports a model to a file that can be transferred to another machine.&lt;/p&gt;&lt;p&gt;The exported file contains the complete model and can be large.&lt;/p&gt;&lt;h3 id=&quot;importing-models&quot;&gt;Importing Models&lt;a class=&quot;h-anchor&quot; href=&quot;#importing-models&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;ollama import &amp;lt; mistral-exported.ollama
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This imports a previously exported model.&lt;/p&gt;&lt;p&gt;Make sure you have enough disk space before importing.&lt;/p&gt;&lt;h2 id=&quot;additional-resources&quot;&gt;Additional Resources&lt;a class=&quot;h-anchor&quot; href=&quot;#additional-resources&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;official-documentation-and-support&quot;&gt;Official Documentation and Support&lt;a class=&quot;h-anchor&quot; href=&quot;#official-documentation-and-support&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Official Documentation&lt;/strong&gt;: &lt;a href=&quot;https://github.com/ollama/ollama/blob/main/README.md&quot;&gt;Ollama Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href=&quot;https://github.com/ollama/ollama&quot;&gt;Ollama on GitHub&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Community Discord&lt;/strong&gt;: &lt;a href=&quot;https://discord.gg/ollama&quot;&gt;Ollama Discord Server&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Issue Tracker&lt;/strong&gt;: &lt;a href=&quot;https://github.com/ollama/ollama/issues&quot;&gt;GitHub Issues&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;model-libraries-and-resources&quot;&gt;Model Libraries and Resources&lt;a class=&quot;h-anchor&quot; href=&quot;#model-libraries-and-resources&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Ollama Library&lt;/strong&gt;: &lt;a href=&quot;https://ollama.com/library&quot;&gt;Official Model Library&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Hugging Face&lt;/strong&gt;: &lt;a href=&quot;https://huggingface.co/models&quot;&gt;Model Repository&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Community Models&lt;/strong&gt;: &lt;a href=&quot;https://ollama.ai/library&quot;&gt;Ollama Community Models&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;These resources provide additional support, updates, and community-contributed content for Ollama users.&lt;/p&gt;&lt;hr/&gt;&lt;h1 id=&quot;ollama-tags-reference-list&quot;&gt;Ollama Tags Reference List&lt;a class=&quot;h-anchor&quot; href=&quot;#ollama-tags-reference-list&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h1&gt;&lt;h2 id=&quot;model-size-tags&quot;&gt;Model Size Tags&lt;a class=&quot;h-anchor&quot; href=&quot;#model-size-tags&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;7b&lt;/code&gt; - 7 billion parameter models&lt;/li&gt;&lt;li&gt;&lt;code&gt;8b&lt;/code&gt; - 8 billion parameter models&lt;/li&gt;&lt;li&gt;&lt;code&gt;13b&lt;/code&gt; - 13 billion parameter models&lt;/li&gt;&lt;li&gt;&lt;code&gt;34b&lt;/code&gt; - 34 billion parameter models&lt;/li&gt;&lt;li&gt;&lt;code&gt;70b&lt;/code&gt; - 70 billion parameter models&lt;/li&gt;&lt;li&gt;&lt;code&gt;latest&lt;/code&gt; - Latest version of a model&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;model-family-tags&quot;&gt;Model Family Tags&lt;a class=&quot;h-anchor&quot; href=&quot;#model-family-tags&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;llama2&lt;/code&gt; - Meta&amp;#39;s Llama 2 model family&lt;/li&gt;&lt;li&gt;&lt;code&gt;llama3&lt;/code&gt; - Meta&amp;#39;s Llama 3 model family&lt;/li&gt;&lt;li&gt;&lt;code&gt;mistral&lt;/code&gt; - Mistral AI models&lt;/li&gt;&lt;li&gt;&lt;code&gt;orca&lt;/code&gt; - Microsoft Research&amp;#39;s Orca models&lt;/li&gt;&lt;li&gt;&lt;code&gt;gemma&lt;/code&gt; - Google&amp;#39;s Gemma models&lt;/li&gt;&lt;li&gt;&lt;code&gt;phi&lt;/code&gt; - Microsoft&amp;#39;s Phi models&lt;/li&gt;&lt;li&gt;&lt;code&gt;wizard&lt;/code&gt; - WizardLM models&lt;/li&gt;&lt;li&gt;&lt;code&gt;vicuna&lt;/code&gt; - Berkeley&amp;#39;s Vicuna models&lt;/li&gt;&lt;li&gt;&lt;code&gt;falcon&lt;/code&gt; - Technology Innovation Institute&amp;#39;s Falcon models&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;specialization-tags&quot;&gt;Specialization Tags&lt;a class=&quot;h-anchor&quot; href=&quot;#specialization-tags&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;instruct&lt;/code&gt; - Fine-tuned for following instructions (e.g., &lt;code&gt;mistral:instruct&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;code&gt;chat&lt;/code&gt; - Optimized for conversation (e.g., &lt;code&gt;llama2:chat&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;code&gt;code&lt;/code&gt; - Specialized for programming (e.g., &lt;code&gt;codellama:7b&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;&lt;code&gt;vision&lt;/code&gt; - Models with image understanding capabilities&lt;/li&gt;&lt;li&gt;&lt;code&gt;math&lt;/code&gt; - Models optimized for mathematical reasoning&lt;/li&gt;&lt;li&gt;&lt;code&gt;medical&lt;/code&gt; - Models with medical knowledge focus&lt;/li&gt;&lt;li&gt;&lt;code&gt;tiny&lt;/code&gt; - Extra small models for resource-constrained environments&lt;/li&gt;&lt;li&gt;&lt;code&gt;uncensored&lt;/code&gt; - Models with fewer content restrictions&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;quantization-tags&quot;&gt;Quantization Tags&lt;a class=&quot;h-anchor&quot; href=&quot;#quantization-tags&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;q4_0&lt;/code&gt; - 4-bit quantization, method 0 (smallest size, lowest quality)&lt;/li&gt;&lt;li&gt;&lt;code&gt;q4_1&lt;/code&gt; - 4-bit quantization, method 1 (better quality than q4_0)&lt;/li&gt;&lt;li&gt;&lt;code&gt;q5_0&lt;/code&gt; - 5-bit quantization&lt;/li&gt;&lt;li&gt;&lt;code&gt;q5_1&lt;/code&gt; - 5-bit quantization, method 1&lt;/li&gt;&lt;li&gt;&lt;code&gt;q8_0&lt;/code&gt; - 8-bit quantization (better quality, larger size)&lt;/li&gt;&lt;li&gt;&lt;code&gt;f16&lt;/code&gt; - 16-bit float precision (high quality, largest size)&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;usage-examples&quot;&gt;Usage Examples&lt;a class=&quot;h-anchor&quot; href=&quot;#usage-examples&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;llama3:8b&lt;/code&gt; - 8B parameter version of Llama 3&lt;/li&gt;&lt;li&gt;&lt;code&gt;codellama:13b-instruct&lt;/code&gt; - 13B CodeLlama optimized for instruction following&lt;/li&gt;&lt;li&gt;&lt;code&gt;mistral:7b-q4_0&lt;/code&gt; - 7B Mistral model with 4-bit quantization for smaller size&lt;/li&gt;&lt;li&gt;&lt;code&gt;llama2:70b-chat-q5_0&lt;/code&gt; - 70B Llama 2 chat model with 5-bit quantization&lt;/li&gt;&lt;li&gt;&lt;code&gt;gemma:2b-instruct&lt;/code&gt; - 2B Gemma instruction model&lt;/li&gt;&lt;li&gt;&lt;code&gt;phi:2.7b&lt;/code&gt; - 2.7B Phi model&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;custom-tags&quot;&gt;Custom Tags&lt;a class=&quot;h-anchor&quot; href=&quot;#custom-tags&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;custom&lt;/code&gt; - User-created model variants&lt;/li&gt;&lt;li&gt;&lt;code&gt;finetune&lt;/code&gt; - Models that have been fine-tuned&lt;/li&gt;&lt;li&gt;&lt;code&gt;merged&lt;/code&gt; - Models created by merging multiple base models&lt;/li&gt;&lt;li&gt;&lt;code&gt;rag&lt;/code&gt; - Models configured for retrieval-augmented generation&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ollama provides a powerful way to run AI language models on your own hardware. With the commands in this guide, you can install, configure, and manage Ollama and its models effectively. As the project is actively developed, check the official documentation for the latest features and best practices.&lt;/p&gt;&lt;p&gt;Remember that running models locally requires substantial resources, especially for larger models. Start with smaller models if you&amp;#39;re facing performance issues, and gradually explore larger ones as you become more familiar with the system.&lt;/p&gt;&lt;p&gt;Consider your security needs when deploying Ollama, especially in multi-user or networked environments. The privacy benefits of local AI only apply when the system is properly secured.&lt;/p&gt;&lt;p&gt;he system.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>Installing Docker on Ubuntu: A Step-by-Step Guide 🚀(with Debugg)</title><link>https://diylabhub.com/installing-docker-on-ubuntu-a-step-by-step-guide-%f0%9f%9a%80with-debugg/</link><guid isPermaLink="true">https://diylabhub.com/installing-docker-on-ubuntu-a-step-by-step-guide-%f0%9f%9a%80with-debugg/</guid><pubDate>Sat, 08 Mar 2025 03:13:38 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Docker simplifies application deployment by packaging software into containers&lt;/p&gt;&lt;p&gt;Here&amp;#39;s how to install Docker on Ubuntu efficiently:&lt;/p&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;1-uninstall-old-versions&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Uninstall Old Versions&lt;a class=&quot;h-anchor&quot; href=&quot;#1-uninstall-old-versions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Remove any previous Docker installations to avoid conflicts&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This ensures a clean environment for the new installation&lt;/p&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;2-set-up-dockers-official-repository&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Set Up Docker&amp;#39;s Official Repository&lt;a class=&quot;h-anchor&quot; href=&quot;#2-set-up-dockers-official-repository&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;a. Install Prerequisite Packages&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Ensure &lt;code&gt;apt&lt;/code&gt; can use repositories over HTTPS&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;b. Add Docker’s GPG Key&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Add Docker&amp;#39;s official GPG key to verify package authenticity&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc &amp;gt; /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.asc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;c. Set Up the Stable Repository&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Add Docker&amp;#39;s repository to your sources list&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;echo \
  &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;$VERSION_CODENAME&amp;quot;) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Then, update the package index&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get update
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;3-install-docker-engine&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Install Docker Engine&lt;a class=&quot;h-anchor&quot; href=&quot;#3-install-docker-engine&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Install Docker Engine and associated components&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command installs:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;docker-ce&lt;/code&gt;: Docker Engine&lt;/li&gt;&lt;li&gt;&lt;code&gt;docker-ce-cli&lt;/code&gt;: Command-line interface for Docker&lt;/li&gt;&lt;li&gt;&lt;code&gt;containerd.io&lt;/code&gt;: Container runtime&lt;/li&gt;&lt;li&gt;&lt;code&gt;docker-buildx-plugin&lt;/code&gt;: Docker Build&lt;/li&gt;&lt;li&gt;&lt;code&gt;docker-compose-plugin&lt;/code&gt;: Docker Compos&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;4-verify-installation&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Verify Installation&lt;a class=&quot;h-anchor&quot; href=&quot;#4-verify-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;a. Check Docker Version&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Confirm the installation by checking the Docker version&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker --version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;b. Run a Test Container&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Run the &amp;quot;Hello World&amp;quot; container to verify Docker is functioning correctly&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command downloads and runs a test image, outputting a confirmation message upon success&lt;/p&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;5-manage-docker-as-a-non-root-user&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Manage Docker as a Non-Root User&lt;a class=&quot;h-anchor&quot; href=&quot;#5-manage-docker-as-a-non-root-user&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To run Docker commands without &lt;code&gt;sudo&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;a. Create Docker Group&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Create the Docker group if it doesn&amp;#39;t already exist&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo groupadd docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;b. Add User to Docker Group&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Add your user to the Docker group&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG docker $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;c. Apply Group Changes&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Log out and log back in to apply the group changes. Alternatively, use&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;d. Verify Non-Root Access&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Run the &amp;quot;Hello World&amp;quot; container without &lt;code&gt;sudo&lt;/code&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;If successful, Docker is configured for non-root usage
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;troubleshooting-common-issues&quot;&gt;Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;a. Permission Denied While Accessing Docker Socket&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Error:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Got permission denied while trying to connect to the Docker daemon socket&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Ensure your user is added to the Docker group&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Verify group membership with&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;groups $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;If the issue persists, adjust the ownership of the Docker directory&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo chown &amp;quot;$USER&amp;quot;:&amp;quot;$USER&amp;quot; /home/&amp;quot;$USER&amp;quot;/.docker -R
sudo chmod g+rwx &amp;quot;$HOME/.docker&amp;quot; -R
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;b. Docker Daemon Not Running&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Error:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Start the Docker service&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl start docker
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;Enable Docker to start on boot&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;c. Old Versions of Docker Installed&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Issue:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Conflicts with previous Docker installations&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Uninstall old Docker versions&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt-get remove docker docker-engine docker.io containerd runc
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;Then, proceed with the installation steps above&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;d. Network Connectivity Issues&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Error:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;Failed to fetch&lt;/code&gt; errors during &amp;quot;apt-get update&amp;quot;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;Check your internet connection -&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Ensure your system&amp;#39;s DNS settings are correctly configured&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;p&gt;By following these steps, you should have Docker successfully installed on your Ubuntu systemFor more detailed information, refer to the [official Docker documentation]&lt;/p&gt;&lt;p&gt;Reference Link: (&lt;a href=&quot;https://docs.docker.com/engine/install/ubuntu/&quot;&gt;https://docs.docker.com/engine/install/ubuntu/&lt;/a&gt;&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>🚀 Setting Up a CI/CD Pipeline with Jenkins on Ubuntu</title><link>https://diylabhub.com/%f0%9f%9a%80-setting-up-a-ci-cd-pipeline-with-jenkins-on-ubuntu/</link><guid isPermaLink="true">https://diylabhub.com/%f0%9f%9a%80-setting-up-a-ci-cd-pipeline-with-jenkins-on-ubuntu/</guid><pubDate>Sat, 08 Mar 2025 03:13:06 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;A &lt;strong&gt;CI/CD (Continuous Integration and Continuous Deployment)&lt;/strong&gt; pipeline automates software development, testing, and deployment. Jenkins is a popular open-source automation server used for CI/CD.&lt;/p&gt;&lt;hr/&gt;&lt;hr/&gt;&lt;h2 id=&quot;1-introduction-to-cicd-and-jenkins&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Introduction to CI/CD and Jenkins&lt;a class=&quot;h-anchor&quot; href=&quot;#1-introduction-to-cicd-and-jenkins&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Continuous Integration (CI):&lt;/strong&gt; Automates code integration, testing, and validation.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Continuous Deployment (CD):&lt;/strong&gt; Automates software release and deployment.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Jenkins:&lt;/strong&gt; An automation server that facilitates CI/CD pipelines.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;2-prerequisites&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#2-prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before starting, ensure you have:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;✅ Ubuntu 20.04 or later&lt;/li&gt;&lt;li&gt;✅ &lt;code&gt;sudo&lt;/code&gt; (administrator) access&lt;/li&gt;&lt;li&gt;✅ Java (JDK) installed (required for Jenkins)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Install Java (JDK 11):&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install -y openjdk-11-jdk
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;3-installing-jenkins-on-ubuntu&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Installing Jenkins on Ubuntu&lt;a class=&quot;h-anchor&quot; href=&quot;#3-installing-jenkins-on-ubuntu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;1. Update the package index:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;2. Add Jenkins repository and GPG key:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee /etc/apt/keyrings/jenkins.asc &amp;gt; /dev/null
echo &amp;quot;deb [signed-by=/etc/apt/keyrings/jenkins.asc] https://pkg.jenkins.io/debian-stable binary/&amp;quot; | sudo tee /etc/apt/sources.list.d/jenkins.list &amp;gt; /dev/null
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;3. Install Jenkins:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update
sudo apt install -y jenkins
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;4. Start and enable Jenkins:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl start jenkins
sudo systemctl enable jenkins
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;4-access-jenkins-web-interface-&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Access Jenkins Web Interface 🌍&lt;a class=&quot;h-anchor&quot; href=&quot;#4-access-jenkins-web-interface-&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Open &lt;a href=&quot;http://localhost:8080&quot;&gt;http://localhost:8080&lt;/a&gt; in your browser.&lt;/li&gt;&lt;li&gt;Retrieve the initial admin password:&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo cat /var/lib/jenkins/secrets/initialAdminPassword
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Follow the setup wizard to install recommended plugins and create an admin user.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;5-installing-essential-jenkins-plugins&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Installing Essential Jenkins Plugins&lt;a class=&quot;h-anchor&quot; href=&quot;#5-installing-essential-jenkins-plugins&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;🔹 &lt;strong&gt;Git Plugin:&lt;/strong&gt; Allows Jenkins to pull code from GitHub/GitLab.&lt;/li&gt;&lt;li&gt;🔹 &lt;strong&gt;Pipeline Plugin:&lt;/strong&gt; Enables declarative pipelines.&lt;/li&gt;&lt;li&gt;🔹 &lt;strong&gt;Docker Pipeline Plugin:&lt;/strong&gt; Required for Docker integration.&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;6-creating-your-first-jenkins-pipeline&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Creating Your First Jenkins Pipeline&lt;a class=&quot;h-anchor&quot; href=&quot;#6-creating-your-first-jenkins-pipeline&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;1. Go to &lt;strong&gt;Jenkins Dashboard → &amp;quot;New Item&amp;quot; → Select &amp;quot;Pipeline&amp;quot;.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;2. Enter a name and click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;3. Under the &amp;quot;Pipeline&amp;quot; section, paste this script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pipeline {
    agent any
    stages {
        stage(&amp;#39;Build&amp;#39;) {
            steps {
                echo &amp;#39;Building the application...&amp;#39;
            }
        }
        stage(&amp;#39;Test&amp;#39;) {
            steps {
                echo &amp;#39;Running tests...&amp;#39;
            }
        }
        stage(&amp;#39;Deploy&amp;#39;) {
            steps {
                echo &amp;#39;Deploying the application...&amp;#39;
            }
        }
    }
}
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;7-integrating-githubgitlab-with-jenkins&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Integrating GitHub/GitLab with Jenkins&lt;a class=&quot;h-anchor&quot; href=&quot;#7-integrating-githubgitlab-with-jenkins&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Modify your pipeline script to fetch code from a Git repository:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pipeline {
    agent any
    stages {
        stage(&amp;#39;Checkout Code&amp;#39;) {
            steps {
                git &amp;#39;https://github.com/your-repo.git&amp;#39;
            }
        }
    }
}
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;8-automating-build-triggers-️&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Automating Build Triggers ⚙️&lt;a class=&quot;h-anchor&quot; href=&quot;#8-automating-build-triggers-️&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Enable &lt;strong&gt;Poll SCM&lt;/strong&gt; to check for repository changes at intervals.&lt;/li&gt;&lt;li&gt;Use &lt;strong&gt;GitHub Webhooks&lt;/strong&gt; to trigger builds on new commits.&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;9-deploying-a-sample-web-app-&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Deploying a Sample Web App 🌐&lt;a class=&quot;h-anchor&quot; href=&quot;#9-deploying-a-sample-web-app-&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;1. Install Docker:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;2. Modify pipeline script to deploy an Nginx container:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;pipeline {
    agent any
    stages {
        stage(&amp;#39;Deploy&amp;#39;) {
            steps {
                sh &amp;#39;docker run -d -p 8080:80 nginx&amp;#39;
            }
        }
    }
}
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After running the pipeline, visit &lt;strong&gt;http://localhost:8080&lt;/strong&gt; to see Nginx running.&lt;/p&gt;&lt;h2 id=&quot;-troubleshooting-common-issues&quot;&gt;🚀 Troubleshooting Common Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#-troubleshooting-common-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Jenkins not starting?&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo systemctl restart jenkins
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Permission issues?&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo usermod -aG jenkins $USER
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Jenkins build failing?&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo journalctl -u jenkins --no-pager
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;-conclusion&quot;&gt;🎯 Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#-conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;✅ You now have a fully functional CI/CD pipeline using Jenkins.&lt;/li&gt;&lt;li&gt;✅ Jenkins automates testing, builds, and deployments.&lt;/li&gt;&lt;li&gt;✅ Next Steps: Add Kubernetes, AWS, or Terraform integrations.&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;-reference-links&quot;&gt;📌 Reference Links&lt;a class=&quot;h-anchor&quot; href=&quot;#-reference-links&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://www.jenkins.io/doc/&quot;&gt;Jenkins Official Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://plugins.jenkins.io/git/&quot;&gt;Git Plugin for Jenkins&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.jenkins.io/doc/book/pipeline/&quot;&gt;Jenkins Pipeline Docs&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;</content:encoded></item><item><title>Complete Guide to Hosting Mermaid Charts Locally</title><link>https://diylabhub.com/complete-guide-to-installing-and-hosting-mermaid-chart-using-docker/</link><guid isPermaLink="true">https://diylabhub.com/complete-guide-to-installing-and-hosting-mermaid-chart-using-docker/</guid><pubDate>Sat, 08 Mar 2025 02:33:37 GMT</pubDate><content:encoded>&lt;article&gt;&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;a class=&quot;h-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Mermaid.js is a powerful JavaScript library designed to create visually appealing diagrams from simple text-based definitions. It supports various diagram types such as flowcharts, sequence diagrams, Gantt charts, class diagrams, and more. Hosting Mermaid locally allows you to quickly visualize documentation, software architectures, or processes without relying on external services, ensuring privacy, security, and offline availability.&lt;/p&gt;&lt;p&gt;This guide covers all available options for hosting Mermaid charts locally, including direct HTML embedding, using local servers (Node.js), Docker setups, and configuration customizations. It also includes security best practices, troubleshooting steps, common issues with solutions, and maintenance procedures.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;required-software-versions&quot;&gt;Required Software Versions:&lt;a class=&quot;h-anchor&quot; href=&quot;#required-software-versions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Node.js v16 or higher&lt;/li&gt;&lt;li&gt;npm or yarn or pnpm (latest stable versions)&lt;/li&gt;&lt;li&gt;Docker (Optional for containerized deployment)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;minimum-hardware-specifications&quot;&gt;Minimum Hardware Specifications:&lt;a class=&quot;h-anchor&quot; href=&quot;#minimum-hardware-specifications&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;CPU: 1 Core&lt;/li&gt;&lt;li&gt;RAM: 512MB minimum&lt;/li&gt;&lt;li&gt;Storage: 500MB free space minimum&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;network-requirements&quot;&gt;Network Requirements:&lt;a class=&quot;h-anchor&quot; href=&quot;#network-requirements&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Ports: Default ports 9000 (for local dev server), 3333 (for docs server)&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;user-permissions&quot;&gt;User Permissions:&lt;a class=&quot;h-anchor&quot; href=&quot;#user-permissions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Standard user with sudo privileges for installations&lt;/li&gt;&lt;li&gt;Avoid running as root unless necessary&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;installation-methods&quot;&gt;Installation Methods&lt;a class=&quot;h-anchor&quot; href=&quot;#installation-methods&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You can host Mermaid locally using one of the following methods:&lt;/p&gt;&lt;h3 id=&quot;option-1-simple-html-file-no-server-required&quot;&gt;Option 1: Simple HTML File (No server required)&lt;a class=&quot;h-anchor&quot; href=&quot;#option-1-simple-html-file-no-server-required&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create an HTML file (&lt;code&gt;mermaid.html&lt;/code&gt;) with the following content:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;xml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;Mermaid Chart Local&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;mermaid&amp;quot;&amp;gt;
        graph LR
        A[Client] --&amp;gt; B[Server]
    &amp;lt;/div&amp;gt;

    &amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;
        import mermaid from &amp;#39;https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs&amp;#39;;
        mermaid.initialize({ startOnLoad: true });
    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Loads Mermaid directly from CDN and renders diagrams in-browser.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic:&lt;/strong&gt; Open this file in your browser. If diagrams don&amp;#39;t render:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Check browser console (F12) for JavaScript errors.&lt;/li&gt;&lt;li&gt;Ensure internet connection to access CDN.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h3 id=&quot;option-2-local-nodejs-setup&quot;&gt;Option 2: Local Node.js Setup&lt;a class=&quot;h-anchor&quot; href=&quot;#option-2-local-nodejs-setup&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install Mermaid via npm/yarn/pnpm:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;npm install mermaid
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;or&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;yarn add mermaid
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;or&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;pnpm add mermaid
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Installs Mermaid as a local dependency.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Diagnostic:&lt;/strong&gt; Verify installation by checking &lt;code&gt;node_modules/mermaid&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Create an HTML file referencing local Mermaid:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;xml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;Mermaid Chart Local&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class=&amp;quot;mermaid&amp;quot;&amp;gt;
        graph TD;
        A --&amp;gt; B;
        B --&amp;gt; C;
    &amp;lt;/div&amp;gt;

    &amp;lt;script type=&amp;quot;module&amp;quot;&amp;gt;
        import mermaid from &amp;#39;./node_modules/mermaid/dist/mermaid.esm.min.mjs&amp;#39;;
        mermaid.initialize({ startOnLoad: true });
    &amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Open this file locally in browser. If diagrams fail:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ensure correct path to &lt;code&gt;mermaid.esm.mjs&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Check browser console for errors.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h3 id=&quot;option-3-using-docker-recommended-for-consistency&quot;&gt;Option 3: Using Docker (Recommended for consistency)&lt;a class=&quot;h-anchor&quot; href=&quot;#option-3-using-docker-recommended-for-consistency&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install Docker first if not installed:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install docker.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Installs Docker on Ubuntu/Debian systems.&lt;/p&gt;&lt;p&gt;Diagnostic command:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker --version
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Create a &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;code&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;m8 7-5 5 5 5M16 7l5 5-5 5&quot;/&gt;&lt;/svg&gt;Code&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;FROM nginx:alpine
COPY . /usr/share/nginx/html
EXPOSE 80
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Build and run your container:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -d -p 8080:80 -v $(pwd):/usr/share/nginx/html nginx:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Serves your current directory via Nginx web server.&lt;/p&gt;&lt;p&gt;Diagnostic: Visit &lt;code&gt;http://localhost:8080&lt;/code&gt; in browser. If page doesn&amp;#39;t load:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Run &lt;code&gt;docker logs [container_id]&lt;/code&gt; to check errors.&lt;/li&gt;&lt;li&gt;Verify port 8080 is open (&lt;code&gt;sudo lsof -i :8080&lt;/code&gt;).&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;configuration-options&quot;&gt;Configuration Options&lt;a class=&quot;h-anchor&quot; href=&quot;#configuration-options&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Mermaid supports multiple configuration sources:&lt;/p&gt;&lt;h3 id=&quot;global-configuration-recommended&quot;&gt;Global Configuration (Recommended):&lt;a class=&quot;h-anchor&quot; href=&quot;#global-configuration-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Set global diagram configuration by modifying your initialization script:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;xml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;xml&quot;&gt;mermaid.initialize({
  theme: &amp;#39;forest&amp;#39;,
  securityLevel: &amp;#39;strict&amp;#39;, // options: strict(default), antiscript, loose, sandbox(beta)
  flowchart: {
    useMaxWidth: true,
    htmlLabels: true,
  }
});
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Customizes global diagram rendering settings.&lt;/p&gt;&lt;p&gt;Diagnostic: If diagrams fail after customization:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Reset configuration by removing custom settings temporarily.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Avoid Running as Root:&lt;/strong&gt; Always run Mermaid under standard user permissions.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Network Access Restriction:&lt;/strong&gt; Limit access via firewall if hosted publicly.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;File Permissions:&lt;/strong&gt; Set restrictive permissions on diagram files:&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;chmod 644 /path/to/your/diagrams/*.html
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Prevents unauthorized file modifications.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;data-persistence--backup-procedures&quot;&gt;Data Persistence &amp;amp; Backup Procedures&lt;a class=&quot;h-anchor&quot; href=&quot;#data-persistence--backup-procedures&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For Docker setups, ensure data persistence by mounting volumes:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker run -d -p 8080:80 -v /path/to/data:/usr/share/nginx/html nginx:latest
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Ensures your Mermaid files persist after container restarts.&lt;/p&gt;&lt;p&gt;Backup regularly using:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;tar czvf mermaid_backup_$(date +%F).tar.gz /path/to/data/
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Restore data easily with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;tar xzvf backup.tar.gz -C /path/to/data/
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;common-issues--solutions&quot;&gt;Common Issues &amp;amp; Solutions&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues--solutions&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Issue&lt;/th&gt;&lt;th&gt;Diagnostic&lt;/th&gt;&lt;th&gt;Solution&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Diagrams not rendering&lt;/td&gt;&lt;td&gt;Browser console errors&lt;/td&gt;&lt;td&gt;Ensure correct Mermaid import paths; verify CDN availability&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Labels out of bounds&lt;/td&gt;&lt;td&gt;Check font loading issues&lt;/td&gt;&lt;td&gt;Initialize Mermaid after DOM load completes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Security restrictions blocking clicks&lt;/td&gt;&lt;td&gt;Check securityLevel setting&lt;/td&gt;&lt;td&gt;Adjust &lt;code&gt;securityLevel&lt;/code&gt; to &amp;quot;loose&amp;quot; or &amp;quot;antiscript&amp;quot;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Example fix for labels out of bounds issue:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;document.addEventListener(&amp;#39;DOMContentLoaded&amp;#39;, () =&amp;gt; {
    mermaid.initialize({ startOnLoad:true });
});
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;known-open-bugs--workarounds&quot;&gt;Known Open Bugs &amp;amp; Workarounds&lt;a class=&quot;h-anchor&quot; href=&quot;#known-open-bugs--workarounds&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Cookiebot Interference Bug (#6045)&lt;/strong&gt;: Diagrams not rendering due to Cookiebot scripts interference. &lt;strong&gt;Workaround&lt;/strong&gt;: Delay Mermaid initialization until after Cookiebot consent scripts have completed loading or disable Cookiebot temporarily during debugging.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;maintenance-guide&quot;&gt;Maintenance Guide&lt;a class=&quot;h-anchor&quot; href=&quot;#maintenance-guide&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;update-installation-safely&quot;&gt;Update Installation Safely:&lt;a class=&quot;h-anchor&quot; href=&quot;#update-installation-safely&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Update Mermaid regularly using npm/yarn/pnpm commands:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;npm update mermaid # or yarn upgrade mermaid or pnpm update mermaid
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Keeps Mermaid up-to-date with latest fixes/features.&lt;/p&gt;&lt;h3 id=&quot;monitor-for-issues&quot;&gt;Monitor for Issues:&lt;a class=&quot;h-anchor&quot; href=&quot;#monitor-for-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check logs regularly (&lt;code&gt;docker logs&lt;/code&gt;) and browser console logs periodically.&lt;/p&gt;&lt;h3 id=&quot;backup-configurations--data-regularly&quot;&gt;Backup Configurations &amp;amp; Data Regularly:&lt;a class=&quot;h-anchor&quot; href=&quot;#backup-configurations--data-regularly&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Copy your HTML and diagram definition files periodically to a secure location:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;cp /path/to/your/files/*.html /backup/location/
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;p&gt;This comprehensive guide ensures you can host Mermaid charts locally with ease, troubleshoot common issues effectively, maintain security best practices, and keep your data safe through regular backups and updates.&lt;/p&gt;&lt;/article&gt;</content:encoded></item><item><title>🐳 Docker Container Monitoring with Prometheus and Grafana: A Comprehensive Guide</title><link>https://diylabhub.com/%f0%9f%90%b3-docker-container-monitoring-with-prometheus-and-grafana-a-comprehensive-guide/</link><guid isPermaLink="true">https://diylabhub.com/%f0%9f%90%b3-docker-container-monitoring-with-prometheus-and-grafana-a-comprehensive-guide/</guid><pubDate>Wed, 05 Mar 2025 03:49:47 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;Monitoring Docker containers is essential for maintaining healthy, high-performing containerized applications. This guide will walk you through setting up a robust monitoring system using Prometheus and Grafana, two powerful open-source tools that work seamlessly together to collect, store, and visualize metrics from your Docker environment.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;understanding-container-monitoring-architecture&quot;&gt;🔹Understanding Container Monitoring Architecture&lt;a class=&quot;h-anchor&quot; href=&quot;#understanding-container-monitoring-architecture&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before diving into the setup, it&amp;#39;s important to understand how the monitoring stack works. In a typical Docker monitoring setup with Prometheus and Grafana, the architecture consists of several components working together:&lt;/p&gt;&lt;p&gt;Prometheus serves as the central metrics collection and storage system. It scrapes metrics from various exporters at regular intervals (typically every 15 seconds) and stores them in its time-series database. Grafana connects to Prometheus as a data source and creates visualizations through dashboards. These components work with specialized exporters that collect specific metrics.&lt;/p&gt;&lt;h3 id=&quot;-prometheus&quot;&gt;📊 Prometheus&lt;a class=&quot;h-anchor&quot; href=&quot;#-prometheus&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;An open-source monitoring system that collects and stores time-series data from configured targets, providing a powerful query language for analyzing metrics.&lt;/p&gt;&lt;h3 id=&quot;-grafana&quot;&gt;📈 Grafana&lt;a class=&quot;h-anchor&quot; href=&quot;#-grafana&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A visualization platform that transforms the metrics collected by Prometheus into informative and customizable dashboards.&lt;/p&gt;&lt;h3 id=&quot;️-node-exporter&quot;&gt;🖥️ Node Exporter&lt;a class=&quot;h-anchor&quot; href=&quot;#️-node-exporter&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A Prometheus exporter for collecting hardware and OS-level metrics from the host system, such as CPU usage, memory consumption, disk I/O, and network statistics.&lt;/p&gt;&lt;h3 id=&quot;-cadvisor-container-advisor&quot;&gt;📦 cAdvisor (Container Advisor)&lt;a class=&quot;h-anchor&quot; href=&quot;#-cadvisor-container-advisor&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A monitoring tool that collects, aggregates, and exports resource usage information from running containers, providing detailed insights into container performance.&lt;/p&gt;&lt;h2 id=&quot;-prerequisites&quot;&gt;🔹 Prerequisites&lt;a class=&quot;h-anchor&quot; href=&quot;#-prerequisites&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Before starting the setup process, ensure you have the following installed on your system:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Docker Engine (latest stable version)&lt;/li&gt;&lt;li&gt;Docker Compose&lt;/li&gt;&lt;li&gt;Basic understanding of YAML configuration files&lt;/li&gt;&lt;li&gt;Access to terminal/command line interface&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;setting-up-your-docker-monitoring-stack&quot;&gt;🔹Setting Up Your Docker Monitoring Stack&lt;a class=&quot;h-anchor&quot; href=&quot;#setting-up-your-docker-monitoring-stack&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;1️⃣-create-directory-structure&quot;&gt;1️⃣ Create Directory Structure&lt;a class=&quot;h-anchor&quot; href=&quot;#1️⃣-create-directory-structure&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, establish a proper directory structure to organize your configuration files:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p docker-monitoring/prometheus
mkdir -p docker-monitoring/grafana/provisioning/datasources
mkdir -p docker-monitoring/grafana/provisioning/dashboards
cd docker-monitoring
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;2️⃣-create-prometheus-configuration&quot;&gt;2️⃣ Create Prometheus Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#2️⃣-create-prometheus-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a file named &lt;code&gt;prometheus.yml&lt;/code&gt; in the prometheus directory:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: &amp;#39;prometheus&amp;#39;
    static_configs:
      - targets: [&amp;#39;localhost:9090&amp;#39;]

  - job_name: &amp;#39;cadvisor&amp;#39;
    static_configs:
      - targets: [&amp;#39;cadvisor:8080&amp;#39;]

  - job_name: &amp;#39;node-exporter&amp;#39;
    static_configs:
      - targets: [&amp;#39;node-exporter:9100&amp;#39;]
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This configuration tells Prometheus to scrape metrics from itself, cAdvisor (for container metrics), and Node Exporter (for host metrics) every 15 seconds.&lt;/p&gt;&lt;h3 id=&quot;3️⃣-create-docker-compose-file&quot;&gt;3️⃣ Create Docker Compose File&lt;a class=&quot;h-anchor&quot; href=&quot;#3️⃣-create-docker-compose-file&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Create a &lt;code&gt;docker-compose.yml&lt;/code&gt; file in the docker-monitoring directory:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;yaml&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;yaml&quot;&gt;version: &amp;#39;3.8&amp;#39;

networks:
  monitoring:
    driver: bridge

volumes:
  prometheus_data: {}
  grafana_data: {}

services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    restart: unless-stopped
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus_data:/prometheus
    command:
      - &amp;#39;--config.file=/etc/prometheus/prometheus.yml&amp;#39;
      - &amp;#39;--storage.tsdb.path=/prometheus&amp;#39;
      - &amp;#39;--web.console.libraries=/etc/prometheus/console_libraries&amp;#39;
      - &amp;#39;--web.console.templates=/etc/prometheus/consoles&amp;#39;
      - &amp;#39;--web.enable-lifecycle&amp;#39;
    ports:
      - &amp;quot;9090:9090&amp;quot;
    networks:
      - monitoring

  node-exporter:
    image: prom/node-exporter:latest
    container_name: node-exporter
    restart: unless-stopped
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command:
      - &amp;#39;--path.procfs=/host/proc&amp;#39;
      - &amp;#39;--path.rootfs=/rootfs&amp;#39;
      - &amp;#39;--path.sysfs=/host/sys&amp;#39;
      - &amp;#39;--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($|/)&amp;#39;
    ports:
      - &amp;quot;9100:9100&amp;quot;
    networks:
      - monitoring

  cadvisor:
    image: gcr.io/cadvisor/cadvisor:latest
    container_name: cadvisor
    restart: unless-stopped
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:ro
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /dev/disk/:/dev/disk:ro
    ports:
      - &amp;quot;8080:8080&amp;quot;
    networks:
      - monitoring

  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: unless-stopped
    volumes:
      - grafana_data:/var/lib/grafana
      - ./grafana/provisioning:/etc/grafana/provisioning
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin
      - GF_USERS_ALLOW_SIGN_UP=false
    ports:
      - &amp;quot;3000:3000&amp;quot;
    networks:
      - monitoring
    depends_on:
      - prometheus
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This Docker Compose file defines four services: Prometheus, Node Exporter, cAdvisor, and Grafana. Each service is configured with appropriate volumes, ports, and network settings.&lt;/p&gt;&lt;h3 id=&quot;4️⃣-launch-the-monitoring-stack&quot;&gt;4️⃣ Launch the Monitoring Stack&lt;a class=&quot;h-anchor&quot; href=&quot;#4️⃣-launch-the-monitoring-stack&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Start all the services using Docker Compose:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose up -d
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This command launches all four containers in detached mode. You can verify that they&amp;#39;re running properly with:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;docker-compose ps
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;-configuring-grafana&quot;&gt;🔹 Configuring Grafana&lt;a class=&quot;h-anchor&quot; href=&quot;#-configuring-grafana&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;1️⃣-access-grafana-dashboard&quot;&gt;1️⃣ Access Grafana Dashboard&lt;a class=&quot;h-anchor&quot; href=&quot;#1️⃣-access-grafana-dashboard&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Open your web browser and navigate to &lt;code&gt;http://localhost:3000&lt;/code&gt;. You&amp;#39;ll be greeted with the Grafana login page. Use the following credentials:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Username:&lt;/strong&gt; admin&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Password:&lt;/strong&gt; admin&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You&amp;#39;ll be prompted to change the password on your first login for security purposes.&lt;/p&gt;&lt;h3 id=&quot;2️⃣-add-prometheus-as-a-data-source&quot;&gt;2️⃣ Add Prometheus as a Data Source&lt;a class=&quot;h-anchor&quot; href=&quot;#2️⃣-add-prometheus-as-a-data-source&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Click on the gear icon (⚙️) in the left sidebar to open the Configuration menu&lt;/li&gt;&lt;li&gt;Select &amp;quot;Data sources&amp;quot;&lt;/li&gt;&lt;li&gt;Click &amp;quot;Add data source&amp;quot;&lt;/li&gt;&lt;li&gt;Select &amp;quot;Prometheus&amp;quot; from the list&lt;/li&gt;&lt;li&gt;Set the URL field to &lt;code&gt;http://prometheus:9090&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Click &amp;quot;Save &amp;amp; Test&amp;quot; to verify the connection&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;If everything is set up correctly, you should see a green &amp;quot;Data source is working&amp;quot; message.&lt;/p&gt;&lt;h3 id=&quot;3️⃣-import-dashboards&quot;&gt;3️⃣ Import Dashboards&lt;a class=&quot;h-anchor&quot; href=&quot;#3️⃣-import-dashboards&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Click the &amp;quot;+&amp;quot; icon in the left sidebar&lt;/li&gt;&lt;li&gt;Select &amp;quot;Import&amp;quot;&lt;/li&gt;&lt;li&gt;Enter one of these dashboard IDs:&lt;ul&gt;&lt;li&gt;893 (Docker and system monitoring)&lt;/li&gt;&lt;li&gt;10619 (Docker containers)&lt;/li&gt;&lt;li&gt;1860 (Node Exporter Full)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Click &amp;quot;Load&amp;quot;&lt;/li&gt;&lt;li&gt;Select your Prometheus data source from the dropdown&lt;/li&gt;&lt;li&gt;Click &amp;quot;Import&amp;quot;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;These dashboards provide comprehensive monitoring for your Docker containers and host system metrics.&lt;/p&gt;&lt;h2 id=&quot;monitoring-multiple-hosts&quot;&gt;🔹Monitoring Multiple Hosts&lt;a class=&quot;h-anchor&quot; href=&quot;#monitoring-multiple-hosts&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If you need to monitor Docker containers across multiple hosts, you&amp;#39;ll need to install Node Exporter and cAdvisor on each host machine, then update your Prometheus configuration to scrape metrics from these additional targets.&lt;/p&gt;&lt;h3 id=&quot;update-prometheus-configuration&quot;&gt;Update Prometheus Configuration&lt;a class=&quot;h-anchor&quot; href=&quot;#update-prometheus-configuration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Modify your &lt;code&gt;prometheus.yml&lt;/code&gt; file to include the additional hosts:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;scrape_configs:
  # Existing jobs...

  - job_name: &amp;#39;node-exporter-host2&amp;#39;
    static_configs:
      - targets: [&amp;#39;host2-ip:9100&amp;#39;]

  - job_name: &amp;#39;cadvisor-host2&amp;#39;
    static_configs:
      - targets: [&amp;#39;host2-ip:8080&amp;#39;]
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;After updating the configuration, reload Prometheus:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;curl -X POST http://localhost:9090/-/reload
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;common-issues-and-troubleshooting&quot;&gt;🔹Common Issues and Troubleshooting&lt;a class=&quot;h-anchor&quot; href=&quot;#common-issues-and-troubleshooting&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;️-issue-1-grafana-cant-connect-to-prometheus&quot;&gt;⚠️ Issue 1: Grafana Can&amp;#39;t Connect to Prometheus&lt;a class=&quot;h-anchor&quot; href=&quot;#️-issue-1-grafana-cant-connect-to-prometheus&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you see a &amp;quot;Bad Gateway&amp;quot; error when trying to connect Grafana to Prometheus, check the following:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Ensure Prometheus container is running: &lt;code&gt;docker ps | grep prometheus&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check Prometheus logs for errors: &lt;code&gt;docker logs prometheus&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Verify network connectivity: In your Docker Compose file, make sure both services are on the same network&lt;/li&gt;&lt;li&gt;Try using the container name instead of IP address in the Grafana data source configuration: &lt;code&gt;http://prometheus:9090&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;️-issue-2-prometheus-configuration-permission-denied&quot;&gt;⚠️ Issue 2: Prometheus Configuration Permission Denied&lt;a class=&quot;h-anchor&quot; href=&quot;#️-issue-2-prometheus-configuration-permission-denied&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If Prometheus fails to start with a permission error like &amp;quot;permission denied&amp;quot; for the configuration file:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check the permissions of your prometheus.yml file&lt;/li&gt;&lt;li&gt;Ensure the file is readable by the Prometheus container&lt;/li&gt;&lt;li&gt;Try adding these permissions: &lt;code&gt;chmod a+r prometheus/prometheus.yml&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;️-issue-3-cadvisor-shows-as-unhealthy&quot;&gt;⚠️ Issue 3: cAdvisor Shows as Unhealthy&lt;a class=&quot;h-anchor&quot; href=&quot;#️-issue-3-cadvisor-shows-as-unhealthy&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If the cAdvisor container shows as unhealthy:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Check the logs: &lt;code&gt;docker logs prometheus-cAdvisor&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Verify the volumes are correctly mounted&lt;/li&gt;&lt;li&gt;Ensure the host system allows access to the Docker socket&lt;/li&gt;&lt;li&gt;Try an older or newer version of cAdvisor if the current one has issues&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;️-issue-4-no-data-appearing-in-grafana-dashboards&quot;&gt;⚠️ Issue 4: No Data Appearing in Grafana Dashboards&lt;a class=&quot;h-anchor&quot; href=&quot;#️-issue-4-no-data-appearing-in-grafana-dashboards&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If your dashboards aren&amp;#39;t showing any data:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Verify Prometheus is scraping metrics successfully: visit &lt;code&gt;http://localhost:9090/targets&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Check the query expression in Grafana&amp;#39;s panel edit mode&lt;/li&gt;&lt;li&gt;Adjust the time range in Grafana to ensure it covers when data was collected&lt;/li&gt;&lt;li&gt;Restart the containers if needed: &lt;code&gt;docker-compose restart&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;-advanced-tips-and-best-practices&quot;&gt;🔹 Advanced Tips and Best Practices&lt;a class=&quot;h-anchor&quot; href=&quot;#-advanced-tips-and-best-practices&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;-persistence-and-data-retention&quot;&gt;💾 Persistence and Data Retention&lt;a class=&quot;h-anchor&quot; href=&quot;#-persistence-and-data-retention&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To ensure your metrics data persists across container restarts, use named volumes for Prometheus and Grafana as shown in the Docker Compose file. You can adjust Prometheus&amp;#39;s data retention period by adding this to the command section:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;command:
  # Existing commands...
  - &amp;#39;--storage.tsdb.retention.time=15d&amp;#39;
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;This sets data retention to 15 days, but you can adjust based on your storage capacity and requirements.&lt;/p&gt;&lt;h3 id=&quot;-security-considerations&quot;&gt;🔒 Security Considerations&lt;a class=&quot;h-anchor&quot; href=&quot;#-security-considerations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Change default credentials immediately after setup&lt;/li&gt;&lt;li&gt;Consider using environment variables for sensitive information rather than hardcoding in files&lt;/li&gt;&lt;li&gt;Restrict access to the Prometheus and Grafana interfaces using a reverse proxy with authentication&lt;/li&gt;&lt;li&gt;Use network segmentation to isolate your monitoring stack from production services&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;-performance-optimization&quot;&gt;⚡ Performance Optimization&lt;a class=&quot;h-anchor&quot; href=&quot;#-performance-optimization&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Adjust scrape intervals based on your needs - more frequent scraping provides higher resolution but increases resource usage&lt;/li&gt;&lt;li&gt;Use recording rules in Prometheus for frequently used or complex queries&lt;/li&gt;&lt;li&gt;Consider federation for large-scale deployments&lt;/li&gt;&lt;li&gt;Monitor the resource usage of your monitoring stack itself&lt;/li&gt;&lt;/ol&gt;&lt;h3 id=&quot;-adding-alerts&quot;&gt;🔔 Adding Alerts&lt;a class=&quot;h-anchor&quot; href=&quot;#-adding-alerts&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While this guide focuses on monitoring, you can extend your setup to include alerting:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Define alerting rules in Prometheus&lt;/li&gt;&lt;li&gt;Set up Alertmanager alongside Prometheus&lt;/li&gt;&lt;li&gt;Configure notification channels in Grafana&lt;/li&gt;&lt;li&gt;Create alert thresholds for critical metrics&lt;/li&gt;&lt;/ol&gt;&lt;h2 id=&quot;-conclusion&quot;&gt;🔹 Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#-conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;You now have a fully functional Docker monitoring stack with Prometheus and Grafana. This setup provides comprehensive visibility into the performance and health of your Docker containers and host system. By following the tips and best practices outlined in this guide, you can ensure your monitoring system remains reliable, secure, and efficient.&lt;/p&gt;&lt;p&gt;Remember that monitoring is an ongoing process. As your containerized applications evolve, you may need to adjust your monitoring strategy by adding more exporters, creating custom dashboards, or implementing automated alerting based on your specific requirements.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;-references&quot;&gt;🔹 References&lt;a class=&quot;h-anchor&quot; href=&quot;#-references&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;Reddit: Getting started Grafana Prometheus monitoring&lt;/li&gt;&lt;li&gt;Reddit: What grafana dashboard you use to monitor docker&lt;/li&gt;&lt;li&gt;Reddit: How do I add Prometheus as a datasource to Grafana&lt;/li&gt;&lt;li&gt;Reddit: Docker monitoring with grafana and adding second host&lt;/li&gt;&lt;li&gt;Building a Docker-based Monitoring System with Prometheus and Grafana&lt;/li&gt;&lt;li&gt;Reddit: Prometheus not working after configuring docker named volumes&lt;/li&gt;&lt;li&gt;Reddit: Monitoring docker-containers with grafana, prometheus &amp;amp; fluent-bit&lt;/li&gt;&lt;li&gt;Reddit: Problems with Grafana and Prometheus Dashboard&lt;/li&gt;&lt;li&gt;Reddit: The Essential Guide to Grafana Docker Monitoring&lt;/li&gt;&lt;li&gt;Server Fault: Still can&amp;#39;t connect from my grafana docker container to prometheus&lt;/li&gt;&lt;li&gt;Kubernetes Training: Prometheus &amp;amp; Grafana: Docker Compose Monitoring Tutorial&lt;/li&gt;&lt;li&gt;Grafana Community: Connection error for data source Prometheus with grafana&lt;/li&gt;&lt;li&gt;Dev.to: How to Set Up Grafana and Prometheus Using Docker&lt;/li&gt;&lt;li&gt;Grafana Community: Tutorial Grafana Fundamentals Docker Prometheus&lt;/li&gt;&lt;li&gt;GitHub: Docker Monitoring Workshop with Grafana Alloy, Prometheus and Loki&lt;/li&gt;&lt;li&gt;YouTube: Install Grafana, Prometheus &amp;amp; Node Exporter with Docker&lt;/li&gt;&lt;/ol&gt;&lt;/article&gt;</content:encoded></item><item><title>🚀 An Introduction to Container Orchestration with Kubernetes</title><link>https://diylabhub.com/%f0%9f%9a%80-an-introduction-to-container-orchestration-with-kubernetes/</link><guid isPermaLink="true">https://diylabhub.com/%f0%9f%9a%80-an-introduction-to-container-orchestration-with-kubernetes/</guid><pubDate>Wed, 05 Mar 2025 03:36:03 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;In today&amp;#39;s cloud-native world, managing containers manually isn&amp;#39;t practical. &lt;strong&gt;Kubernetes (K8s)&lt;/strong&gt; is the most popular container orchestration platform that automates the deployment, scaling, and operation of containerized applications.&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;1-what-is-container-orchestration&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;What is Container Orchestration?&lt;a class=&quot;h-anchor&quot; href=&quot;#1-what-is-container-orchestration&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Containerization&lt;/strong&gt; packages applications into lightweight, portable environments.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Orchestration&lt;/strong&gt; automates container lifecycle management.&lt;/li&gt;&lt;li&gt;Tools like Kubernetes handle scheduling, scaling, and networking of containers.&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;2-why-use-kubernetes&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Why Use Kubernetes?&lt;a class=&quot;h-anchor&quot; href=&quot;#2-why-use-kubernetes&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Kubernetes provides:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;✅ &lt;strong&gt;Automated Scaling:&lt;/strong&gt; Adjusts resources based on demand.&lt;/li&gt;&lt;li&gt;✅ &lt;strong&gt;Self-Healing:&lt;/strong&gt; Automatically restarts failed containers.&lt;/li&gt;&lt;li&gt;✅ &lt;strong&gt;Load Balancing:&lt;/strong&gt; Distributes traffic efficiently.&lt;/li&gt;&lt;li&gt;✅ &lt;strong&gt;Service Discovery:&lt;/strong&gt; Enables easy container communication.&lt;/li&gt;&lt;li&gt;✅ &lt;strong&gt;Rolling Updates:&lt;/strong&gt; Deploys application updates seamlessly.&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;3-installing-kubernetes-on-ubuntu&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Installing Kubernetes on Ubuntu&lt;a class=&quot;h-anchor&quot; href=&quot;#3-installing-kubernetes-on-ubuntu&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To install Kubernetes, follow these steps:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;1. Update System Packages:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;2. Install Docker (Container Runtime):&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y docker.io
sudo systemctl enable --now docker
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;3. Install Kubernetes Tools:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo apt install -y apt-transport-https curl
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo &amp;quot;deb https://apt.kubernetes.io/ kubernetes-xenial main&amp;quot; | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt update
sudo apt install -y kubelet kubeadm kubectl
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;4. Disable Swap (Kubernetes requirement):&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo swapoff -a
sudo sed -i &amp;#39;/ swap / s/^/#/&amp;#39; /etc/fstab
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;5. Initialize Kubernetes Cluster:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;sudo kubeadm init --pod-network-cidr=192.168.1.0/16
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Follow the output instructions to configure &lt;code&gt;kubectl&lt;/code&gt;:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;6. Install a Network Plugin (e.g., Flannel):&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;h2 id=&quot;4-understanding-kubernetes-components&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Understanding Kubernetes Components&lt;a class=&quot;h-anchor&quot; href=&quot;#4-understanding-kubernetes-components&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Master Node:&lt;/strong&gt; Controls and manages worker nodes.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Worker Nodes:&lt;/strong&gt; Run containerized applications.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Pods:&lt;/strong&gt; The smallest unit in Kubernetes, containing one or more containers.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Services:&lt;/strong&gt; Expose applications running on Pods.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Deployments:&lt;/strong&gt; Define how applications should be managed and scaled.&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;5-deploying-a-sample-app-on-kubernetes&quot; class=&quot;is-step&quot;&gt;&lt;span class=&quot;step-tag&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;step-sep&quot;&gt;. &lt;/span&gt;Deploying a Sample App on Kubernetes&lt;a class=&quot;h-anchor&quot; href=&quot;#5-deploying-a-sample-app-on-kubernetes&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;#39;s deploy an Nginx web server on Kubernetes:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;1. Create a Deployment YAML file:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;nano nginx-deployment.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Add the following configuration:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;2. Deploy the Application:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl apply -f nginx-deployment.yml
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;3. Check Deployment Status:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl get pods
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;4. Expose the Deployment:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl expose deployment nginx-deployment --type=NodePort --port=80
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;5. Get Access URL:&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl get svc
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Now, visit &lt;code&gt;http://:&lt;/code&gt; to see the Nginx app running.&lt;/p&gt;&lt;h2 id=&quot;-troubleshooting-kubernetes-issues&quot;&gt;🚀 Troubleshooting Kubernetes Issues&lt;a class=&quot;h-anchor&quot; href=&quot;#-troubleshooting-kubernetes-issues&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;1. Kubernetes Pods Not Running?&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl get pods -A
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;Check logs for errors:&lt;/p&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;span class=&quot;cb-lang&quot;&gt;bash&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;kubectl logs 
&lt;/pre&gt;&lt;/figure&gt;&lt;p&gt;&lt;strong&gt;2. Cluster Initialization Failed?&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ensure you have disabled swap.&lt;/li&gt;&lt;li&gt;Check &lt;code&gt;kubeadm init&lt;/code&gt; logs for details.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;3. Issues with Node Connectivity?&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ensure the network plugin (Flannel) is installed.&lt;/li&gt;&lt;li&gt;Check node status using: &lt;code&gt;kubectl get nodes&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;-conclusion&quot;&gt;🎯 Conclusion&lt;a class=&quot;h-anchor&quot; href=&quot;#-conclusion&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;✅ Kubernetes automates container deployment, scaling, and networking.&lt;/li&gt;&lt;li&gt;✅ Master nodes manage worker nodes and workloads.&lt;/li&gt;&lt;li&gt;✅ Deployments and services make Kubernetes a powerful orchestrator.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;-reference-links&quot;&gt;📌 Reference Links&lt;a class=&quot;h-anchor&quot; href=&quot;#-reference-links&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://kubernetes.io/docs/home/&quot;&gt;Kubernetes Official Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://kubernetes.io/docs/setup/&quot;&gt;Kubernetes Setup Guide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://github.com/kubernetes/kubernetes&quot;&gt;Kubernetes GitHub Repository&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/article&gt;</content:encoded></item><item><title>Docker Installation on Ubuntu(Simple)</title><link>https://diylabhub.com/docker-installation-on-ubuntusimple/</link><guid isPermaLink="true">https://diylabhub.com/docker-installation-on-ubuntusimple/</guid><pubDate>Wed, 05 Mar 2025 02:20:50 GMT</pubDate><content:encoded>&lt;article&gt;&lt;p&gt;When installing Docker on Ubuntu, there are multiple options and configurations to consider both during and after installation. Here’s a comprehensive guide:&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;https://altisconsulting.com/au/wp-content/uploads/sites/4/2017/07/Untitled-1.png&quot; alt/&gt;&lt;/p&gt;&lt;hr/&gt;&lt;h2 id=&quot;during-installation&quot;&gt;&lt;strong&gt;During Installation&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#during-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;1-install-from-the-official-ubuntu-repository-basic&quot;&gt;&lt;strong&gt;1. Install from the Official Ubuntu Repository (Basic)&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#1-install-from-the-official-ubuntu-repository-basic&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt update
sudo apt install docker.io -y
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Simple, stable.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cons&lt;/strong&gt;: Might not have the latest version.&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;2-install-from-dockers-official-repository-recommended&quot;&gt;&lt;strong&gt;2. Install from Docker’s Official Repository (Recommended)&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#2-install-from-dockers-official-repository-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt update
sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc &amp;gt; /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
  &amp;quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release &amp;amp;&amp;amp; echo &amp;quot;$VERSION_CODENAME&amp;quot;) stable&amp;quot; | sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Latest stable version, full feature set.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cons&lt;/strong&gt;: Slightly longer setup.&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;3-install-from-a-deb-package-offline-installation&quot;&gt;&lt;strong&gt;3. Install from a DEB Package (Offline Installation)&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#3-install-from-a-deb-package-offline-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;wget https://download.docker.com/linux/ubuntu/dists/$(lsb_release -cs)/pool/stable/amd64/docker-ce_XX.YY.ZZ~3-0~ubuntu_amd64.deb
sudo dpkg -i docker-ce_XX.YY.ZZ~3-0~ubuntu_amd64.deb
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Useful for air-gapped environments.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cons&lt;/strong&gt;: Manual updates required.&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;4-install-using-snap-not-recommended&quot;&gt;&lt;strong&gt;4. Install Using Snap (Not Recommended)&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#4-install-using-snap-not-recommended&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo snap install docker
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Easy installation and updates.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cons&lt;/strong&gt;: Can have permission issues with volume mounts.&lt;/li&gt;&lt;/ul&gt;&lt;hr/&gt;&lt;h2 id=&quot;after-installation&quot;&gt;&lt;strong&gt;After Installation&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#after-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;1-verify-installation&quot;&gt;&lt;strong&gt;1. Verify Installation&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#1-verify-installation&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;docker --version
docker info
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;2-start-and-enable-docker-service&quot;&gt;&lt;strong&gt;2. Start and Enable Docker Service&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#2-start-and-enable-docker-service&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl start docker
sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;3-run-a-test-container&quot;&gt;&lt;strong&gt;3. Run a Test Container&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#3-run-a-test-container&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo docker run hello-world
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;4-allow-non-root-users-to-run-docker&quot;&gt;&lt;strong&gt;4. Allow Non-root Users to Run Docker&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#4-allow-non-root-users-to-run-docker&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Pros&lt;/strong&gt;: Run Docker without &lt;code&gt;sudo&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Cons&lt;/strong&gt;: May have security risks.&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;5-enable-docker-to-start-on-boot&quot;&gt;&lt;strong&gt;5. Enable Docker to Start on Boot&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#5-enable-docker-to-start-on-boot&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl enable docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;6-configure-docker-daemon-settings&quot;&gt;&lt;strong&gt;6. Configure Docker Daemon Settings&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#6-configure-docker-daemon-settings&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Edit the configuration file:&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo nano /etc/docker/daemon.json
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;Example configuration:&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;{
  &amp;quot;log-driver&amp;quot;: &amp;quot;json-file&amp;quot;,
  &amp;quot;log-opts&amp;quot;: { &amp;quot;max-size&amp;quot;: &amp;quot;10m&amp;quot;, &amp;quot;max-file&amp;quot;: &amp;quot;3&amp;quot; },
  &amp;quot;storage-driver&amp;quot;: &amp;quot;overlay2&amp;quot;,
  &amp;quot;insecure-registries&amp;quot;: [&amp;quot;myregistry.local:5000&amp;quot;]
}
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;Restart Docker:&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;7-check-logs&quot;&gt;&lt;strong&gt;7. Check Logs&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#7-check-logs&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo journalctl -u docker --no-pager
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;8-install-docker-compose&quot;&gt;&lt;strong&gt;8. Install Docker Compose&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#8-install-docker-compose&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt install docker-compose-plugin
docker compose version
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;9-set-up-a-private-docker-registry&quot;&gt;&lt;strong&gt;9. Set Up a Private Docker Registry&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#9-set-up-a-private-docker-registry&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;docker run -d -p 5000:5000 --restart=always --name registry registry:2
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;10-remove-docker-if-needed&quot;&gt;&lt;strong&gt;10. Remove Docker (if needed)&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#10-remove-docker-if-needed&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo apt remove docker-ce docker-ce-cli containerd.io -y
sudo rm -rf /var/lib/docker /etc/docker
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;h2 id=&quot;optional-configurations&quot;&gt;&lt;strong&gt;Optional Configurations&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#optional-configurations&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3 id=&quot;--use-different-storage-drivers&quot;&gt;&lt;strong&gt;- Use Different Storage Drivers&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#--use-different-storage-drivers&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;docker info | grep &amp;quot;Storage Driver&amp;quot;
&lt;/pre&gt;&lt;/figure&gt;&lt;ul&gt;&lt;li&gt;Change driver (Example: &lt;code&gt;overlay2&lt;/code&gt;):&lt;/li&gt;&lt;/ul&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl stop docker
sudo rm -rf /var/lib/docker
sudo nano /etc/docker/daemon.json
# Add:
{
  &amp;quot;storage-driver&amp;quot;: &amp;quot;overlay2&amp;quot;
}
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;--enable-ipv6&quot;&gt;&lt;strong&gt;- Enable IPv6&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#--enable-ipv6&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo nano /etc/docker/daemon.json
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;file&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z&quot;/&gt;&lt;path d=&quot;M14 3v5h5M9 13h6M9 17h4&quot;/&gt;&lt;/svg&gt;File content&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;{
  &amp;quot;ipv6&amp;quot;: true,
  &amp;quot;fixed-cidr-v6&amp;quot;: &amp;quot;2001:db8:1::/64&amp;quot;
}
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;h3 id=&quot;--configure-remote-api&quot;&gt;&lt;strong&gt;- Configure Remote API&lt;/strong&gt;&lt;a class=&quot;h-anchor&quot; href=&quot;#--configure-remote-api&quot; aria-label=&quot;Link to this section&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo nano /lib/systemd/system/docker.service
# Modify ExecStart:
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
&lt;/pre&gt;&lt;/figure&gt;&lt;figure class=&quot;cb&quot; data-kind=&quot;cmd&quot;&gt;&lt;figcaption class=&quot;cb-head&quot;&gt;&lt;span class=&quot;cb-kind&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;16&quot; height=&quot;16&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;3&quot; y=&quot;4&quot; width=&quot;18&quot; height=&quot;16&quot; rx=&quot;2.5&quot;/&gt;&lt;path d=&quot;m7 9 3 3-3 3M12.5 15H17&quot;/&gt;&lt;/svg&gt;Run in terminal&lt;/span&gt;&lt;button class=&quot;cb-copy&quot; type=&quot;button&quot; data-label=&quot;Copy command&quot;&gt;&lt;svg class=&quot;ico&quot; width=&quot;15&quot; height=&quot;15&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;1.9&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; aria-hidden=&quot;true&quot;&gt;&lt;rect x=&quot;9&quot; y=&quot;9&quot; width=&quot;12&quot; height=&quot;12&quot; rx=&quot;2&quot;/&gt;&lt;path d=&quot;M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1&quot;/&gt;&lt;/svg&gt;&lt;span&gt;Copy command&lt;/span&gt;&lt;/button&gt;&lt;/figcaption&gt;&lt;pre&gt;sudo systemctl daemon-reload
sudo systemctl restart docker
&lt;/pre&gt;&lt;/figure&gt;&lt;hr/&gt;&lt;p&gt;These steps cover all major aspects of Docker installation and configuration on Ubuntu.🚀&lt;/p&gt;&lt;/article&gt;</content:encoded></item></channel></rss>