Installation
Ubuntu Installation
Ensure your Ubuntu system meets the minimum requirements: Ubuntu 20.04 or later, 8GB RAM (16GB recommended), and sufficient disk space for models (typically 4-7GB per model).
1.Install Ollama using the official installation script:
Bash
curl -fsSL https://ollama.ai/install.sh | sh
2.Alternatively, download and install manually:
Bash
wget https://github.com/ollama/ollama/releases/latest/download/ollama-linux-amd64
sudo mv ollama-linux-amd64 /usr/local/bin/ollama
sudo chmod +x /usr/local/bin/ollama
3.Create the ollama user and service:
Bash
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
sudo usermod -a -G ollama $(whoami)
4.Start the Ollama service:
Bash
sudo systemctl enable ollama
sudo systemctl start ollama
RHEL8 Installation
For Red Hat Enterprise Linux 8, first install required dependencies:
Bash
sudo dnf install -y curl wget tar
Download the Ollama binary:
Bash
curl -L https://ollama.ai/download/ollama-linux-amd64 -o ollama
sudo mv ollama /usr/local/bin/
sudo chmod +x /usr/local/bin/ollama
5.Create system user and directories:
Bash
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
sudo mkdir -p /etc/systemd/system
6.Create systemd service file:
Bash
sudo tee /etc/systemd/system/ollama.service > /dev/null <<EOF
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
[Install]
WantedBy=default.target
EOF
7.Enable and start the service:
Bash
sudo systemctl daemon-reload
sudo systemctl enable ollama
sudo systemctl start ollama