{"id":1035,"date":"2024-08-29T12:05:26","date_gmt":"2024-08-29T12:05:26","guid":{"rendered":"https:\/\/zahiralam.com\/blog\/?p=1035"},"modified":"2024-08-29T12:10:08","modified_gmt":"2024-08-29T12:10:08","slug":"how-to-install-open-webui-with-ollama-on-ubuntu-24-04-for-offline-ai-mastery","status":"publish","type":"post","link":"https:\/\/zahiralam.com\/blog\/how-to-install-open-webui-with-ollama-on-ubuntu-24-04-for-offline-ai-mastery\/","title":{"rendered":"How to Install Open WebUI with Ollama on Ubuntu 24.04 for Offline AI Mastery"},"content":{"rendered":"\n<p>If you&#8217;re seeking a robust, self-hosted solution for managing large language models (LLMs) offline, Open WebUI is an excellent choice. Compatible with LLM runners like Ollama and OpenAI-compatible APIs, Open WebUI enables you to run these models in a secure, offline environment. This guide will walk you through setting up Open WebUI on Ubuntu 24.04.\n\n\n\n<p><strong>Before You Start: Prerequisites<\/strong>\n\n\n\n<p>To get started with Open WebUI, ensure your Ubuntu system has Docker installed. Docker is essential for running Open WebUI as it allows you to deploy the WebUI in a containerized environment. If Docker is not installed on your system, you can easily install it by following the <a href=\"https:\/\/zahiralam.com\/blog\/quickly-install-docker-on-your-ubuntu-24-04-system\/\">Docker installation guide for Ubuntu<\/a>.\n\n\n\n<p>Additionally, if you haven&#8217;t yet installed Ollama, you&#8217;ll need to do that first. Refer to our comprehensive guide on <a href=\"https:\/\/zahiralam.com\/blog\/setting-up-ollama-on-ubuntu-a-beginners-guide\/\">installing Ollama on Ubuntu<\/a> for detailed instructions.\n\n\n\n<p><strong>Step 1: Download and Run the Open WebUI Docker Image<\/strong>\n\n\n\n<p>The first step in setting up Open WebUI is to download its Docker image. Open a terminal window and execute the following command:\n\n\n\n<div class=\"code-block-container\">\n                        <pre class=\"wp-block-code\"><code id=\"code-1\">docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:\/app\/backend\/data --name open-webui --restart always ghcr.io\/open-webui\/open-webui:main<\/code><\/pre>\n                        <amp-iframe sandbox=\"allow-scripts\" width=\"94\" height=\"72\" frameborder=\"0\" \n                                    src=\"https:\/\/zahiralam.com\/blog\/wp-content\/plugins\/amp-copy-code-button\/copier.html#docker%20run%20-d%20-p%203000%3A8080%20--add-host%3Dhost.docker.internal%3Ahost-gateway%20-v%20open-webui%3A%2Fapp%2Fbackend%2Fdata%20--name%20open-webui%20--restart%20always%20ghcr.io%2Fopen-webui%2Fopen-webui%3Amain\">\n                            <button class=\"copy-button\" data-label=\"docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:\/app\/backend\/data --name open-webui --restart always ghcr.io\/open-webui\/open-webui:main\"  placeholder disabled>Copy<\/button>\n                        <\/amp-iframe>\n                    <\/div>\n\n\n\n<p>This command accomplishes several things:\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Pulls the Open WebUI Docker image<\/strong> from the GitHub Container Registry.<\/li>\n\n\n\n<li><strong>Runs the container in detached mode<\/strong> (<code>-d<\/code>), meaning it will operate in the background.<\/li>\n\n\n\n<li><strong>Maps port 8080 inside the container to port 3000 on your machine<\/strong> (<code>-p 3000:8080<\/code>), allowing you to access Open WebUI via your web browser.<\/li>\n\n\n\n<li><strong>Adds a host entry for Docker&#8217;s internal gateway<\/strong> (<code>--add-host=host.docker.internal:host-gateway<\/code>).<\/li>\n\n\n\n<li><strong>Sets up a persistent volume<\/strong> (<code>-v open-webui:\/app\/backend\/data<\/code>) to ensure your data is not lost when the container is stopped or restarted.<\/li>\n\n\n\n<li><strong>Names the container &#8220;open-webui&#8221;<\/strong> and configures it to restart automatically (<code>--restart always<\/code>).<\/li>\n<\/ol>\n\n\n\n<p>After running this command, Docker will begin pulling the necessary image layers. Once completed, the container will start automatically.\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1677\" height=\"386\" src=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-21.png\" alt=\"docker open webui download in ubuntu\" class=\"wp-image-1045\" srcset=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-21.png 1677w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-21-300x69.png 300w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-21-1024x236.png 1024w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-21-768x177.png 768w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-21-1536x354.png 1536w\" sizes=\"auto, (max-width: 1677px) 100vw, 1677px\" \/><\/figure>\n\n\n\n<p><strong>Step 2: Accessing Open WebUI on Ubuntu<\/strong>\n\n\n\n<p>With the Docker container running, you can access Open WebUI by navigating to <code>http:\/\/localhost:3000<\/code> in your web browser. When prompted, log in to Open WebUI. \n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"532\" height=\"382\" src=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-22.png\" alt=\"Login Open webui\" class=\"wp-image-1047\" srcset=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-22.png 532w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-22-300x215.png 300w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/figure>\n\n\n\n<p>All your data is stored locally on your Ubuntu system, ensuring maximum privacy and security.<br>For new user click on <strong>Sign up<\/strong> and register\n\n\n\n<p><strong>Step 3: Getting Acquainted with the Open WebUI Dashboard<\/strong>\n\n\n\n<p>Upon logging in, you\u2019ll be welcomed by the Open WebUI dashboard. This user-friendly interface is your gateway to managing various LLM models and tools.\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"535\" src=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23-1024x535.png\" alt=\"Open WebUi Dashboard Ubuntu\" class=\"wp-image-1048\" srcset=\"https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23-1024x535.png 1024w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23-300x157.png 300w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23-768x401.png 768w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23-1536x802.png 1536w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23-1800x940.png 1800w, https:\/\/zahiralam.com\/blog\/wp-content\/uploads\/2024\/08\/image-23.png 1850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Here\u2019s a brief overview of what you can do within the dashboard:\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Start a New Chat<\/strong>: Quickly initiate a conversation with the AI model.<\/li>\n\n\n\n<li><strong>Explore Your Workspace<\/strong>: Manage and organize your files and projects.<\/li>\n\n\n\n<li><strong>Search for Features<\/strong>: Easily locate specific functionalities using the search bar.<\/li>\n\n\n\n<li><strong>Select a Model<\/strong>: Choose from the available models to begin your work.<\/li>\n<\/ul>\n\n\n\n<p>The left sidebar provides easy navigation, while the top menu allows for quick model selection and customization based on your needs.\n\n\n\n<p><strong>Conclusion<\/strong>\n\n\n\n<p>Congratulations! You&#8217;ve successfully set up Open WebUI on your Ubuntu 24.04 system. This powerful platform is now ready for you to explore its many features, all while keeping your data securely offline.\n\n\n\n<p>If you encounter any challenges during the installation process, don&#8217;t hesitate to consult the official Open WebUI documentation or seek help from the community. Enjoy your journey into offline AI mastery!\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re seeking a robust, self-hosted solution for managing large language models (LLMs) offline, Open WebUI is an excellent choice. Compatible with LLM runners like [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":1058,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[214],"tags":[21,230,66],"class_list":["post-1035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-installation","tag-ollama","tag-open-webui","tag-ubuntu-24-04"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/1035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/comments?post=1035"}],"version-history":[{"count":5,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/1035\/revisions"}],"predecessor-version":[{"id":1050,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/posts\/1035\/revisions\/1050"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media\/1058"}],"wp:attachment":[{"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/media?parent=1035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/categories?post=1035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahiralam.com\/blog\/wp-json\/wp\/v2\/tags?post=1035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}