Aloha is a self-hosted chat application that connects to a local Ollama instance. It provides a modern chat interface similar to ChatGPT but runs entirely on your own infrastructure.
-
Install Ollama on Ubuntu:
curl -fsSL https://ollama.com/install.sh | sh -
Pull a model:
For example, to pull Llama 3:
ollama pull llama3
-
Start the Ollama service:
systemctl start ollama
-
(Optional) Configure Ollama for Network Access:
If running Ollama on a separate server, you need to configure it to allow network access. This requires setting theOLLAMA_HOSTandOLLAMA_ORIGINSenvironment variables.Here's how to do it on Linux:
a. Edit the systemd service file for Ollama:
sudo systemctl edit ollama.service
b. Add the following content to the file:
[Service] Environment="OLLAMA_HOST=0.0.0.0" Environment="OLLAMA_ORIGINS=*"
c. Reload the systemd daemon and restart Ollama:
sudo systemctl daemon-reload sudo systemctl restart ollama
For more details, refer to the Ollama FAQ.
- By default, the Ollama API is available at:
http://localhost:11434
- By default, the Ollama API is available at:
-
Clone the repository:
git clone <repo-url> cd <repo-name>
-
Install dependencies:
npm install
-
Configure environment variables:
Edit the
.envfile:vim .env
Set the Ollama API URL (replace
192.168.x.xwith the appropriate IP if running remotely):VITE_URL=http://192.168.x.x:11434
-
Start the development server:
npm run dev
-
Build for production:
npm run build
The application's model selection list is generated from the official Ollama library. To keep this list current, you can run the following command:
npm run update-modelsThis script fetches the latest models and updates src/constants/models.ts automatically.
By default, the application connects to Ollama at:
http://localhost:11434
To change this, update OLLAMA_API_URL in:
src/lib/api.ts
- Do not expose the Ollama API directly to the internet.
- Use a reverse proxy with proper security headers if external access is needed.
- Implement authentication for the web application if hosting publicly.
This project is licensed under the MIT License.
