Getting Python running on a fresh Ubuntu 26.04 server is usually one of the first things you do before starting any real development work. Whether you’re deploying a web app, running automation scripts, or setting up a backend service, a clean Python environment is the foundation.
On Ubuntu, the process is usually quick, but there are a few things worth doing properly from the start — especially if you plan to work with virtual environments or deploy projects to production.
Before you start: check if Python is already installed
Most Ubuntu 26.04 installations already include Python 3. The first step is simply to confirm it:
python3 --versionIf you see a version number, Python is already available. If not, you’ll install it in the next step.
Install Python on Ubuntu 26.04
Start by updating your package list. This avoids dependency issues later:
sudo apt update && sudo apt upgrade -yNow install Python 3:
sudo apt install python3 -yCheck the installation:
python3 --versionAt this point, Python is ready to use.
Install pip (you will need it almost immediately)
If you plan to install any Python libraries (Flask, Django, requests, etc.), pip is required.
Install it with:
sudo apt install python3-pip -yVerify:
pip3 --versionSet up a proper development environment
Using the system-wide Python installation for application development is discouraged because it couples project dependencies with OS-level packages, which can lead to version conflicts and unstable behavior during updates. A more reliable approach is to isolate each project in its own environment using Python virtual environments.
Start by installing the required system packages for environment management and package compilation:
sudo apt install python3-venv python3-dev build-essential -yThis provides:
- venv for creating isolated Python environments
- development headers required for building native extensions
- compiler toolchain for packages that include C/C++ bindings
Real-world example: setting up a small Python project
Let’s say you want to quickly test a simple web service on your Ubuntu server.
After activating your virtual environment:
pip install flaskCreate a file:
nano app.pyAdd a minimal Flask app:
from flask import Flask
app = Flask(name)
@app.route("/")
def home():
return "Python is running on Ubuntu 26.04"
if name == "main":
app.run(host="0.0.0.0", port=5000)
Run it:
python app.pyNow you have a working Python service running on your server. This is often the first step before deploying something more serious.
Why developers use Serverspace for Python projects
When you’re working with Python on Ubuntu, local machines are not always the best option — especially if you’re testing deployments, APIs, or background services.
With Serverspace, you can spin up a ready Ubuntu VPS in minutes and work exactly like you would on a production server.
Typical workflow looks like this:
- Create an Ubuntu 26.04 VPS in the Serverspace control panel
- Connect via SSH and install Python (same steps as above)
- Deploy your project or test environment
- Scale resources when needed without downtime
If you’re working with web apps or automation tools, it’s often easier to develop directly on a VPS instead of syncing between local and server environments.
You can explore more about cloud infrastructure and deployment options here:
https://serverspace.us/services/cloud-servers/
Common issues (and what actually fixes them)
Python command not found
On Ubuntu, the command is usually python3 instead of python.
If you want python to point to python3:
sudo apt install python-is-python3pip is installed but not working
This usually happens when pip is installed for a different Python version. Try:
python3 -m pip --versionVirtual environment not activating
Most of the time it’s just missing permissions or wrong folder. Make sure you are inside your project directory:
cd my-project
source venv/bin/activateOld Python version from repositories
Ubuntu repositories sometimes lag behind official Python releases. If you need a newer version, consider:
compiling from source
using a version manager like pyenv
Conclusion
Installing Python on Ubuntu 26.04 is straightforward, but the real value comes from setting it up properly — using pip, isolating environments, and keeping projects structured.
Once your environment is ready, you can move on to building APIs, automation scripts, or full backend services without worrying about system conflicts.
If you’re deploying to production or testing real-world workloads, using a VPS from Serverspace is often the most practical next step.