Open Weight Models · linux · Lesson 2
Install Ollama and check your setup
Prepare your computer and verify that your local Ollama service is ready.
linux version. Use Linux shell for terminal commands. The exercises and setup instructions below are tailored to this version.
What you will learn
- Install Ollama using the official instructions for your operating system.
- Distinguish the command-line client from the background service.
- Verify that the client is installed and can reach the local service without downloading a model.
- Recognise an empty model list as a valid starting state.
Check this Linux machine before installing
Open your Linux terminal. Record the distribution and machine architecture, then review the official Ollama Linux guide and hardware list. The current installer maps x86_64 to amd64 and aarch64/arm64 to arm64; do not select an unrelated binary when your machine is unsupported.
Ollama has a terminal client and a server process. Installation, starting that server, and downloading a model are separate steps. This lesson stops at a working server and Python check; the first model download is in lesson 3.
Identify the Linux environment · bash
cat /etc/os-release
uname -m
command -v curl
python3 --versionUse the distribution's package guidance
If curl, Python 3, or an installer dependency is missing, use your distribution's official package instructions. Ubuntu and Fedora links are included below as examples for those distributions. APT is not a universal Linux package manager.
Download, review, then run the Linux installer
Use the official installer endpoint. The first block creates your course folder and downloads a script without running it. Stop if the download fails. Open the saved script in your text editor or the less viewer; press q to leave less.
Run the final block only after reviewing the installer and confirming the installation fits this computer. It can change system files, configure an Ollama user/service, and request sudo. Keep the install output for troubleshooting. For a manual package installation, follow the matching architecture in the official Linux guide.
1. Create the folder and download the installer · bash
mkdir -p "$HOME/CyberCorps/open-weight-models"
cd "$HOME/CyberCorps/open-weight-models"
curl -fsSL https://ollama.com/install.sh -o ollama-install.sh2. Read the downloaded script · bash
less ollama-install.sh3. After review, install from the saved script · bash
sh ollama-install.shChoose one way to run the server
If this machine runs systemd and the installer created ollama.service, inspect that service first. An active service needs no second server. If the installed unit is inactive, start it with the second block and inspect its status again.
A missing unit or a message that systemd is not the init system does not prove the Ollama binary failed to install. On a non-systemd or deliberate manual setup with no existing server, run the foreground command in terminal A and leave it open. Use terminal B for client commands; stop your own foreground server with Ctrl+C when finished.
Systemd with an installed Ollama unit: inspect first · bash
systemctl status ollama --no-pagerSystemd only: start an installed but inactive unit · bash
sudo systemctl start ollama
systemctl status ollama --no-pagerAlternative: foreground server with no existing service · bash
ollama serveAn address-in-use error needs investigation
Try ollama list from another terminal to see whether an existing server answers. Do not repeatedly launch servers or kill unrelated processes. Stay with the service mode you selected throughout the course, so you use the same server account and model inventory.
Verify the client and local connection
Use a client terminal, separate from a foreground server if you started one. The version command checks the client; list also contacts the configured server. A table with no models is a successful fresh-install result.
Record the version, any warning, and your chosen server mode. If the shell cannot find ollama, check the installation output and PATH. If list cannot connect, inspect the installed service or the foreground terminal before proceeding.
Linux client terminal · bash
ollama --version
ollama listVerify Python for the later API project
Run python3 --version and record the Python 3 version. If the command is missing, follow your distribution's official Python package instructions, then repeat the check. Use the linked Ubuntu guide only on Ubuntu and the Fedora guide on Fedora; consult your distribution for other systems.
The two course scripts use Python's standard library. No pip package or administrator-level Python command is needed to run them. Keep the distribution's system Python intact and run your own files as your normal user.
Check the Linux Python interpreter · bash
python3 --versionRecord a working Linux setup
Record /etc/os-release, uname -m, and the relevant official installation instructions. Review the downloaded installer before executing it.
Choose and record one server mode: installed systemd service or foreground ollama serve. Confirm the selected server is available before opening another client terminal.
Run ollama --version and ollama list. Save the real output, including an empty model inventory if this is a fresh installation.
Run python3 --version. If needed, install Python using this distribution's official instructions and repeat the check.
Write down how you will start, inspect, and stop your chosen server. Record any unresolved error before moving on.
You have completed this task when…
- You have recorded the Linux distribution, architecture, Ollama version, and Python 3 version.
- ollama list contacts the server successfully, and you understand why an empty inventory is valid.
- Only your chosen server mode owns the endpoint; your notes distinguish systemd commands from the foreground workflow.
Official documentation
Use these references for platform requirements, current options, and further detail.