
Open WebUI is a self-hosted, feature-rich, and user-friendly open-source web interface that lets you run large language models (LLMs) using Ollama and OpenAI-compatible APIs. You can extend Open WebUI with AI models and plugins to suit your needs.
This article explains how to install Open WebUI and run large language models (LLMs) using Ollama on a Vultr Cloud GPU instance. You will also configure Open WebUI with secure SSL certificates to expose the web interface using a custom domain.
Before you begin:
Deploy a Vultr Cloud GPU instance with at least 8 GB RAM to run LLMs. Choose:
8 GB for 7B models16 GB for 13B models32 GB for 33B models.Set up a domain A recording pointing to the instance's public IP address. For example, openwebui.example.com.
Access the instance using SSH as a non-root sudo user.
Ollama is a lightweight, extensible framework for running open-source LLMs such as Llama, Code Llama, Mistral, and Gemma. Ollama integrates with application frameworks using APIs to create, manage, and customize models. Open WebUI requires Ollama to run and manage LLMs. Follow the steps below to install Ollama and download a sample model to run using Open WebUI.
Download the Ollama installation script.
Grant execute permissions to the script.
Run the script to install Ollama.
Output:
Enable the Ollama system service to start at boot.
Start the Ollama service.
View the Ollama service status and verify it's running.
Output:
Use Ollama to download a sample model such as llama3:8b.
Output:
You can install Open WebUI using Python Pip or Docker. The Pip method requires the Python version 3.11 while Docker uses a prebuilt Open WebUI container image. Follow the steps below to install Open WebUI using both methods.
Install Python 3.11 version.
Install Open WebUI.
Upgrade pillow and pyopenssl modules.
Run Open WebUI and verify it does not return errors.
Output:
Press Ctrl + C to stop the application.
If you install Open WebUI using Pip, the application runs using the open-webui serve command. You should create a system service to manage the Open WebUI processes without running the open-webui serve command directly. Follow the steps below.
Create a new /usr/lib/systemd/system/openwebui.service system service file using a text editor like vim.
Add the following service configurations to the /usr/lib/systemd/system/openwebui.service file.
Save and close the file.
In the above system service configuration, starting the Open WebUI service automatically runs the open-webui serve command on your server.
Reload systemd to apply the new service configuration.
Enable the Open WebUI system service to start at boot.
Start the Open WebUI service.
Test the Open WebUI service status and confirm it's running.
Output:
Verify that Docker is running on your server.
Output:
Run sudo systemctl start docker to start Docker in case you receive the following error.
Verify that a GPU device is available on your server.
Pull the Open WebUI Docker image for Nvidia GPUs to your server.
To use Open WebUI on a non-GPU server, download the main Docker image instead.
Run Open WebUI and use all Nvidia GPU devices on the host server.
In the above command, Docker runs Open WebUI using the open-webui:cuda container image you downloaded earlier with the following options:
-p 8080:8080: Maps the host port 8080 to the Open WebUI container port 8080 for access on your server.--gpus all: Enables Open WebUI to access all GPUs available on your server.--add-host=host.docker.internal:host-gateway: Enables the Open WebUI container to communicate with services outside Docker that are installed on the server.-v open-webui:/app/backend/data: Creates a new open-webui volume and mounts it to /app/backend/data inside the Open WebUI container.--name open-webui-new: Sets the Open WebUI container name for visibility and management.--restart always: Enables the Open WebUI container to automatically restart in case the container stops unexpectedly.ghcr.io/open-webui/open-webui:cuda: Specifies the Open WebUI docker image to run.Ensure that the Open WebUI Docker container is running.
Output:
You can access the Open WebUI on the default port 8080 using your server's IP address or linked domain. Exposing the Open WebUI port in a production environment is insecure. You can use Nginx as a reverse proxy to handle secure connections to the Open WebUI's backend port using HTTP or HTTPS. In the following steps, install Nginx and create a new virtual host configuration to access Open WebUI on your server.
Install Nginx.
Start the Nginx system service.
If you receive an error, stop Apache or any other application using the HTTP port 80 on your server to enable Nginx to run.
Create a new /etc/nginx/sites-available/openwebui.conf virtual host for Open WebUI.
Add the following Nginx configurations to the /etc/nginx/sites-available/openwebui.conf file.
Save the file.
Link the openwebui.conf configuration to the sites-enabled directory to enable it.
Test Nginx for configuration errors.
Output:
Restart Nginx to apply the Open WebUI virtual host configuration changes.
Allow HTTP connections through the firewall.
SSL certificates encrypt the connection between a client's web browser and your server. Use a trusted certificate authority (CA) like Let's Encrypt to generate SSL certificates and secure connections to the Open WebUI using your Nginx configuration. In the following steps, install the Certbot Let's Encrypt client and generate SSL certificates to access Open WebUI using your domain.
Install Certbot for Nginx.
Generate a new SSL certificate for your domain. Replace openwebui.example.com with your domain and admin@example.com with an active email address.
Output:
Restart Nginx to apply the SSL configuration changes.
Allow HTTPS connections through the firewall.
You can access Open WebUI using your domain based on the configuration steps you performed earlier. In the following steps, access Open WebUI and create a new administrator account to run LLMs on the server.
Access your Open WebUI's domain to access the web interface.
Click Get started to access Open WebUI.
Enter a new administrator username, email address, and password in the Open WebUI fields.
Click Create Admin Account to create the first Open WebUI administrator account.
Confirm that the Open WebUI page displays in your browser, click the Arena Model drop-down in the top menu, and select the Llama 8b model you installed earlier.
Enter a new prompt like Hello today! Write me a simple poem to generate a result using the default Llama 8b model you installed earlier.
Open WebUI ships with some default AI models. You can also install new models directly using Ollama on the server or by uploading the model files through the Open WebUI interface. In the following steps, install new models using Ollama and run them using Open WebUI.
Visit the Ollama library and find new models.
Download a new model. For example, the mistral 7B model.
Download another model, such as llama3:70b.
The llama3:70b model is 40GB and requires more RAM to run on the server.
Restart Open WebUI to synchronize the new model changes.
Or, restart the Open WebUI system service.
Access Open WebUI in a new web browser.
Click the models list on the top left drop-down list and verify the new models are available.
Select a model to use in Open WebUI. For example, select the Mistral model you installed.
Enter a new prompt in the input field, such as What is Vultr? and verify that the model processes new results.
Open WebUI is a powerful web interface for running ML LLMs on a server. In this guide, you installed Open WebUI on a Vultr Cloud GPU instance and secured it with SSL certificates. You can customize the Open WebUI interface and create multiple users to log in or sign up to use LLMs directly on your server. For additional guidelines, please refer to the Open WebUI documentation.
0 Comments
Be the first to comment and share your perspective with the community.