How to Install a Fully Local Private GPT on Ubuntu 20.04

Hey, I'm a postgraduate in Cyber Security with practical experience in Software Engineering and DevOps Operations. The top player on TryHackMe platform, multilingual speaker (Kazakh, Russian, English, Spanish, and Turkish), curios person, bookworm, geek, sports lover, and just a good guy to speak with!
In this article I will show how to install a fully local version of the PrivateGPT on Ubuntu 20.04 machine.
PrivateGPT is a project developed by Iván Martínez, which allows you to run your own GPT model trained on your data, local files, documents and etc. It is free and can run without internet access in local setup mode. Project is open-sourced and available at https://github.com/imartinez/privateGPT
My local setup includes the following components of the PrivateGPT:
Prerequisites:
Before installation ensure that you have satisfied these prerequisites:
Python version 3.11. To install and set the 3.11 version you can use pyenv tool:
💡To install pyenv on your machine checkout this article: How to install 'pyenv' Python version manager on Ubuntu 20.04pyenv install 3.11 pyenv global 3.11For dependency management install Poetry:
curl -sSL https://install.python-poetry.org | python3 -Ensure that you have
maketool installed:make --version
Install PrivateGPT:
Clone PrivateGPT repository, and navigate to it:
git clone https://github.com/imartinez/privateGPT cd privateGPTInstall Ollama for LLM and Embeddings:
curl -fsSL https://ollama.com/install.sh | shEnsure that your
ollamaservice is running:ollama servesudo systemctl status ollama.serviceNow in a separate terminal install the default models and settings from
settings-ollama.yamlfile:sudo ollama pull mistral sudo ollama pull nomic-embed-textIf you want to run
ollamawithoutsudo, then add your user account to therendergroup:sudo usermod -aG render <your_username>after adding the group log out and log back in to make the changes take effect.
To list the groups your user belongs to use:
groupsInstall PrivateGPT with the following command:
poetry install --extras "ui llms-ollama embeddings-ollama vector-stores-qdrant"Once installed, you can run PrivateGPT. Before that ensure that you have a working Ollama running locally.
PGPT_PROFILES=ollama make run
Now you can access your PrivateGPT UI http://localhost:8001/






