Cómo instalar Ollama con Open-WebUI: Guía paso a paso

Cómo instalar Ollama con Open-WebUI: Guía paso a paso

Si estás experimentando con modelos de lenguaje de inteligencia artificial (LLMs) de forma local, probablemente ya conozcas Ollama. Pero trabajar exclusivamente desde la terminal puede resultar un poco limitante. Aquí es donde entra en juego Open-WebUI.

Open-WebUI es una plataforma de IA autoalojada, extensible y con una interfaz muy amigable (increíblemente similar a ChatGPT) que funciona de manera 100% offline. En esta guía, basada en la documentación oficial de su GitHub, te mostraré cómo instalar ambos usando Docker de manera rápida y sin complicaciones.

Requisitos Previos 🛠️

Antes de empezar, asegúrate de tener instalado Docker en tu sistema. Si tienes pensado utilizar aceleración por tarjeta gráfica (NVIDIA), también necesitarás el Nvidia CUDA container toolkit.

Nota importante: En los comandos a continuación, verás que incluimos la ruta -v open-webui:/app/backend/data. Este paso es crucial, ya que garantiza que tu base de datos se monte correctamente y previene que pierdas tus chats si el contenedor se apaga o reinicia.


Métodos de Instalación (Inicio rápido con Docker) 🐳

Existen varias formas de configurar tu entorno dependiendo de tu hardware o de si ya instalaste Ollama antes. Elige el escenario que mejor encaje contigo:

Opción 1: Instalación de Open-WebUI con Ollama integrado (Todo en uno)

Este es el método más rápido si comienzas desde cero. Utiliza una única imagen de Docker que empaqueta Open-WebUI junto con Ollama, permitiéndote levantar todo con un solo comando.

Para equipos con soporte GPU (Recomendado):

Si tienes una tarjeta gráfica dedicada y quieres sacarle el máximo partido, usa este comando:

Bash
docker run -d -p 3000:8080 --gpus=all -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
 

Para equipos usando solo CPU:

Si no cuentas con una GPU y vas a depender de tu procesador, ejecuta lo siguiente:

Bash
docker run -d -p 3000:8080 -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
 
Para actualizar WebUI con Ollama:
# 1. Stop and remove the container (data in the volume is preserved)
docker rm -f open-webui

# 2. Pull the latest image (or replace :main with a pinned version)
docker pull ghcr.io/open-webui/open-webui:ollama
Bash
docker run -d -p 3000:8080 -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama
 

Opción 2: Si ya tienes Ollama instalado en tu computadora

Si descargaste Ollama de forma nativa en tu ordenador y ya lo tienes corriendo en segundo plano, todo lo que necesitas hacer es levantar Open-WebUI y decirle cómo comunicarse con tu máquina local:

Bash
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
 

Opción 3: Si Ollama está en un servidor distinto

¿Tienes un servidor potente (o NAS) dedicado para correr los modelos y quieres levantar la interfaz gráfica en tu equipo de trabajo? Puedes conectarlos modificando la variable de entorno OLLAMA_BASE_URL. Solo tienes que cambiar https://example.com por la IP o dirección de tu servidor:

Bash
docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=https://example.com -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
 

¡Accede a tu nueva interfaz! 😄

Una vez que ejecutes el comando elegido, Docker descargará lo necesario y encenderá la plataforma. ¡Ya casi terminas! Simplemente abre tu navegador web favorito y dirígete a:

👉 http://localhost:3000

Lo primero que harás será crear tu cuenta de administrador. Una vez dentro, podrás descargar modelos como Llama 3, Mistral o Phi directamente desde la configuración de la interfaz visual y comenzar a interactuar de forma totalmente privada.

⚠️ Solución a problemas comunes: "Server Connection Error"

Si abres la interfaz y notas que Open-WebUI no logra comunicarse con Ollama, a menudo se debe a que el contenedor no puede alcanzar el servidor interno (127.0.0.1:11434). Para solucionarlo, puedes aplicar el parámetro --network=host en tu comando Docker.

Ejemplo de cómo quedaría el comando para solucionarlo:

Bash
docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
 

Atención: Si usas --network=host, notarás que el puerto de acceso cambiará del habitual 3000 al 8080, por lo que tendrás que entrar a través de http://localhost:8080.


¿Te resultó útil esta guía para montar tu propio laboratorio de IA? ¡Déjanos un comentario contándonos qué modelos tienes pensado probar primero!

Y sigue...

Para que tu blog esté completo, no podemos dejar la conexión "al desnudo". Si vas a acceder a tu Open-WebUI desde fuera de tu red local o simplemente quieres dormir tranquilo sabiendo que tus chats están cifrados, usar Apache2 como Proxy Inverso es la jugada maestra.

Aquí tienes cómo configurar Apache2 para ponerle ese candadito verde (HTTPS) a tu instalación.


Asegurando Open-WebUI con Apache2 y HTTPS 🔐

Tener la interfaz corriendo en el puerto 3000 está bien para pruebas, pero en producción querrás usar un dominio (ej: ia.tu-dominio.com) y cifrado SSL.

1. Instalar Apache y activar los módulos necesarios

Primero, necesitamos que Apache sepa cómo "redirigir" el tráfico hacia el contenedor de Docker. Para ello, activamos los módulos de proxy:

Bash
sudo apt update
sudo apt install apache2 -y
sudo a2enmod proxy proxy_http ssl rewrite headers
sudo systemctl restart apache2

2. Configurar el VirtualHost de Apache

Ahora crearemos un archivo de configuración para tu sitio. Reemplaza ia.tu-dominio.com por tu dominio real.

sudo nano /etc/apache2/sites-available/open-webui.conf

Pega el siguiente contenido (ajustando el puerto si usas uno distinto al 3000):

Apache
<VirtualHost *:80>
    ServerName ia.tu-dominio.com

    # Redirigir todo el tráfico HTTP a HTTPS automáticamente
    RewriteEngine On
    RewriteCond %{SERVER_NAME} =ia.tu-dominio.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
    ServerName ia.tu-dominio.com

    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/

    # Opcional: Configuración para WebSockets
# (necesario para algunas funciones de tiempo real)
RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L] ErrorLog ${APACHE_LOG_DIR}/openwebui-error.log CustomLog ${APACHE_LOG_DIR}/openwebui-access.log combined </VirtualHost>

Guarda (Ctrl+O, Enter) y sal (Ctrl+X). Luego, activa el sitio:

Bash
sudo a2ensite open-webui.conf
sudo systemctl reload apache2

3. Obtener un certificado SSL gratuito con Let's Encrypt 💡

Hoy en día no tiene sentido pagar por certificados. Vamos a usar Certbot para obtener uno de Let's Encrypt que se renueva solo.

Bash
sudo apt install python3-certbot-apache -y
sudo certbot --apache -d ia.tu-dominio.com

Sigue las instrucciones en pantalla. Certbot modificará automáticamente tu archivo de configuración para añadir las rutas de las llaves SSL y forzar el tráfico seguro.


Consideraciones de Seguridad adicionales

  • Firewall (UFW): Si tienes el firewall activo, recuerda permitir el tráfico web:

    sudo ufw allow 'Apache Full'

  • Acceso local vs externo: Una vez que el proxy inverso funcione, podrías cerrar el puerto 3000 en tu router o firewall y dejar abierto solo el 80 y 443. Así, la única forma de entrar será a través de la conexión cifrada que acabas de crear.

Tip de pro: Si usas Open-WebUI para manejar documentos sensibles (RAG), el HTTPS no es opcional, es obligatorio. Nadie quiere que sus PDFs privados viajen en texto plano por la red.


¿Tienes pensado abrir el acceso a otros usuarios en tu blog o prefieres mantener la instancia de Open-WebUI como una herramienta estrictamente personal?


LATINCHAIN PLATFORM



news.latin-chain.com/
LatinChain Platform: Pi Hackathon winner 2021.
Welcome to LatinChain Ecosystem portal on Pi Network cryptocurrency ecosystem. Get utility usage bonus by using Mainnet and Testnet.


Understanding the LatinChain Ecosystem

Your gateway to decentralized applications on the Pi Network.


Welcome to the LatinChain Ecosystem portal. As a decentralized application (dApp) built on the Pi Network, our goal is to provide real utility and seamless interaction for the Pi community. Whether you are a developer, a pioneer, or a casual user, understanding the difference between our Mainnet and Testnet environments is crucial for maximizing your experience.



Staking Pi to Boost Rank

Did you know you can directly support the growth of LatinChain Mainnet?

By Staking Pi on our app within the Pi Browser, you help boost our ranking in the ecosystem directory. A higher rank means more visibility, bringing more Pioneers into our community and increasing the value of the network for everyone.

Support us today and help LatinChain reach the top!



Why Choose the Mainnet?

The LatinChain Mainnet (latinchain.pinet.com) is the live production environment where real value is exchanged. By accessing the Mainnet, you are interacting with the fully operational version of our blockchain application.

  • Real Utility: Every action contributes to the genuine activity of the network.
  • Verified Status: Users who choose to support the ecosystem via donations can unlock "Verified" status. This signals your commitment to the community.
  • Double Utility Bonus: Active usage on the Mainnet contributes to your Pi utility usage bonus.


The Role of the Testnet

The Testnet serves as our sandbox environment. It is designed for users who want to explore new features, test transaction flows, or understand the mechanics of the LatinChain token without using real Pi. It is the perfect training ground for new pioneers to get comfortable with Web3 interactions before moving to the Mainnet.



How the LatinChain Token Works

LatinChain is designed to foster a digital economy within the Pi Browser. By participating in either network, you are helping to stress-test and improve a growing financial ecosystem.



Select an option above to begin your journey.

The Evolution of Cryptocurrency: From Bitcoin's Genesis to Pi Network's Ecosystem (2008-nowadays)

The world of finance was forever changed in the aftermath of the 2008 global financial crisis. What started as an obscure proposal on a cryptography mailing list has transformed into a global technological revolution. Here is the journey of cryptocurrency from its inception to the present day.



The Genesis: Bitcoin and the Decentralized Dream (2008-2010)

In October 2008, an anonymous entity named Satoshi Nakamoto published a whitepaper titled "Bitcoin: A Peer-to-Peer Electronic Cash System." It introduced a revolutionary concept: a decentralized digital currency that required no central bank or administrator.

  • The Genesis Block: On January 3, 2009, the first block of the Bitcoin network was mined, setting the foundation for a new financial paradigm.
  • Proof of Work: This brilliant consensus mechanism solved the double-spending problem, ensuring complete trust in a trustless digital environment.



Programmable Money: Ethereum and the DeFi Explosion (2015-2021)

While Bitcoin proved the concept of digital scarcity, developers soon realized blockchain technology could do much more. In 2015, Ethereum launched, introducing "smart contracts"—self-executing code that lives directly on the blockchain.

  • Decentralized Finance (DeFi): Ethereum enabled the creation of lending platforms, decentralized exchanges, and automated market makers.
  • Mainstream Awareness: By 2021, the crypto market reached unprecedented heights, driven by global retail interest, digital art (NFTs), and the exciting promise of Web3.



Maturation and Institutional Adoption (2022-2024)

Following the euphoric highs of previous years, the industry entered a vital period of maturation. The global focus shifted from pure speculation to building robust, scalable infrastructure.

  • Layer 2 Solutions: New networks built on top of base blockchains made transactions significantly faster and cheaper.
  • Wall Street Entry: Major traditional financial institutions embraced Bitcoin ETFs, permanently cementing cryptocurrency as a legitimate and highly sought-after asset class.



The Accessibility Revolution: Pi Network (2025-nowadays)

Despite massive industry growth, a major barrier remained: traditional crypto mining was expensive and technically complex. Enter Pi Network, a visionary project designed to put cryptocurrency directly into the hands of everyday people. By nowadays, Pi Network has beautifully solidified its vision of creating a truly inclusive digital economy.

  • Mobile-First Innovation: Pi revolutionized accessibility by allowing users to mine directly from their smartphones without draining battery life or data.
  • Global Community: It successfully built one of the largest, most engaged, and widely distributed communities in the entire Web3 space.
  • Everyday Utility: With a robust ecosystem of decentralized applications (dApps) and an innovative native KYC solution, Pi Network empowers millions of everyday users to transact, build, and interact seamlessly.



Takeaway: The journey from 2008 to nowadays highlights a monumental shift from niche cryptography to universal accessibility, paving the way for a financial future that truly includes everyone.

Comments

Popular posts from this blog

Pi Network Apps published on Pi Network Ecosystem

Proyecto para Red Social gigante (Giant Social Network project)

Sígueme en mis Redes Sociales (Follow me in my Social Networks). OpenSource Expert 🇻🇪