How to Install Anaconda on Ubuntu Linux in 5 Steps
Install Anaconda on Ubuntu: download the installer, verify it, run it, set up the shell, and create a first environment. With Miniconda as the lighter choice.
3 min readBy Smita
Reviewed by the AmazingRDP technical team

Long-running notebooks and jobs belong on a server. A Linux VPS gives you root access. See Linux VPS from $6.99
Anaconda is a distribution of Python (and R) for data science. It brings its own Python, the package manager conda, and several hundred scientific packages already built, so that NumPy, pandas and Jupyter work without compiling anything. It installs into your home folder and leaves the system's own Python alone.
Anaconda or Miniconda?
| Anaconda | Miniconda | |
|---|---|---|
| Contains | Python, conda and a large collection of packages | Python and conda only |
| Disk space | Several gigabytes | A few hundred megabytes |
| Best for | A desktop where you want everything ready | Servers, and anyone who installs only what a project needs |
The steps below are the same for both; only the installer's file name differs. A note on licensing: Anaconda's terms require a paid licence for use inside larger organisations. Read the current terms on its website if you install it for work. The community installer Miniforge works the same way and uses only the community package channel.
Step 1: download the installer
On anaconda.com, open the download page, choose Linux, and copy the link of the 64-bit installer (a file ending in .sh).
cd /tmp
wget PASTE-THE-LINK-HERE
On a desktop you can simply download it with the browser.
Step 2: verify it
sha256sum Anaconda3-*.sh
Compare the long number with the one published for that file on Anaconda's site. If they differ, the download is damaged or not genuine; do not run it.
Step 3: run the installer
bash Anaconda3-*.sh
- Press Enter to read the licence, and type
yesto accept it. - Accept the suggested location in your home folder.
- When asked whether to initialise conda for your shell, answer
yes.
Do not run the installer with sudo. It belongs to your user.
Step 4: activate and check
source ~/.bashrc
conda --version
conda list | head
The prompt now starts with (base), the name of the default environment. If you would sooner not have it active in every terminal:
conda config --set auto_activate_base false
Step 5: create an environment for your project
Do not install project packages into base. Give each project its own environment, with its own Python version and packages, so that projects cannot break each other.
conda create -n analysis python=3.12 pandas jupyterlab
conda activate analysis
python --version
conda deactivate
| Command | Does |
|---|---|
conda env list | Lists your environments |
conda install NAME | Adds a package to the active environment |
conda update --all | Updates the active environment |
conda env export > environment.yml | Writes down the environment so that others can recreate it |
conda env create -f environment.yml | Recreates it elsewhere |
conda env remove -n analysis | Removes an environment |
conda and pip together
Inside an environment, install with conda first and use pip only for packages conda does not have. Mixing them freely in the same environment is the usual cause of broken installations. See also upgrading pip on Ubuntu for the system Python.
Jupyter on a remote server
On a server without a screen, start Jupyter without a browser and reach it through an SSH tunnel:
jupyter lab --no-browser --port 8888
On your own computer:
ssh -L 8888:localhost:8888 user@203.0.113.10
Then open the address with the token that Jupyter printed, replacing the host with localhost. Do not open port 8888 in the firewall: a notebook server is a way to run any command on the machine.
Update and remove
conda update conda
conda update anaconda
To take Anaconda off the machine, erase its folder in your home directory (anaconda3) and the block of lines between # >>> conda initialize and # <<< conda initialize in ~/.bashrc.
Problems
| Sign | Cause |
|---|---|
conda: command not found | The shell was not initialised. Run ~/anaconda3/bin/conda init and open a new terminal |
| "Solving environment" takes very long | Too many packages in one environment, often base. Create a fresh, smaller one |
| Disk fills up | conda clean --all clears downloaded package files |
| System tools behave oddly | base is active and its Python shadows the system's. Switch auto-activation off (step 4) |
| Killed during installation | Too little memory; a small server needs 2 GB or Miniconda |
For computations that run for hours, a server spares your laptop: see our Linux VPS plans. Editing notebooks and code on that server from your own machine is described in VS Code on Ubuntu.
Questions
How do I install Anaconda on Ubuntu?
Download the Linux installer from anaconda.com, run it with bash, accept the licence and let it initialise your shell.
What is the difference between Anaconda and Miniconda?
Anaconda includes a large collection of packages. Miniconda contains only Python and conda, and you install what you need.
Should I install Anaconda with sudo?
No. Install it as your own user into your home folder.
How do I create a conda environment?
Run conda create -n NAME python=3.12 and then conda activate NAME.