Set Up AI/ML on Ubuntu 26.04 LTS with TensorFlow & PyTorch

Ubuntu 26.04 LTS: AI/ML Setup with TensorFlow & PyTorch

Ubuntu 26.04 LTS is optimized for modern workloads, making it ideal for Artificial Intelligence (AI) and Machine Learning (ML). This guide explains how to install and configure TensorFlow and PyTorch on HostPalace servers running Ubuntu 26.04 LTS.


Step 1: Update Your Server

sudo apt update && sudo apt upgrade -y

Always update your server before installing AI tools to ensure compatibility.


Step 2: Install Python and pip

sudo apt install python3 -y

sudo apt install python3-pip -y

Python is the primary language for AI frameworks.


Step 3: Create a Virtual Environment

sudo apt install python3-venv -y

python3 -m venv ai-env

source ai-env/bin/activate

Virtual environments isolate AI projects for better management.


Step 4: Install TensorFlow

pip install tensorflow

TensorFlow is a popular deep learning framework for neural networks.


Step 5: Install PyTorch

pip install torch torchvision torchaudio

PyTorch is widely used for research and production AI workloads.


Step 6: Verify Installation

Check TensorFlow:

python3 -c "import tensorflow as tf; print(tf.__version__)"

Check PyTorch:

python3 -c "import torch; print(torch.__version__)"


Step 7: Install Jupyter Notebook (Optional)

pip install notebook

jupyter notebook

Run Jupyter Notebook for interactive AI development.


Best Practices

  • Use virtual environments for each AI project
  • Leverage HostPalace GPU servers for faster training
  • Regularly update frameworks to access new features
  • Secure your environment with UFW and SSH hardening

test

Note: HostPalace provides AI-ready servers with optimized hardware and software configurations, making it easy to deploy machine learning and deep learning workloads on Ubuntu 26.04 LTS.