Conda is a powerful open-source package and environment management system. It allows you to easily manage different versions of Python and other programming languages, as well as their dependencies. If you need to use Conda on a remote server via SSH, this guide will walk you through the process of installing it step-by-step.
Before you begin the installation process, make sure you have the following:
First, you need to establish a connection to your server using SSH. Open a terminal (on Linux or macOS) or a tool like PuTTY (on Windows) and connect to your server:
ssh username@server_ip_address
Replace username
with your server’s username and server_ip_address
with the IP address of the server. You’ll be prompted to enter the password for the user account.
Once you’re logged into your server, it’s a good idea to update the system packages to ensure everything is up to date. Use the following commands to update:
sudo apt update && sudo apt upgrade -y
sudo yum update -y
To install Conda, you’ll need to download the appropriate Miniconda installer script. Miniconda is a minimal installer for Conda that provides the basic functionality and allows you to install only the packages you need. There are different installers for 32-bit and 64-bit systems, so choose the one that matches your server architecture.
To download the installer for Linux, run the following command:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
If you prefer the Anaconda distribution (which includes Conda and many other packages), you can download it with this command instead:
wget https://repo.anaconda.com/archive/Anaconda3-2025.01-Linux-x86_64.sh
Before running the installer, it’s a good practice to verify the downloaded script’s integrity. This ensures that the file wasn’t corrupted during the download. You can do this by checking its hash:
sha256sum Miniconda3-latest-Linux-x86_64.sh
Compare the output to the hash provided on the Conda website to ensure they match.
Now, it’s time to install Conda. Run the installer script with the following command:
bash Miniconda3-latest-Linux-x86_64.sh
This will start the Miniconda installation process. Follow the on-screen prompts:
yes
to accept the license agreement.~/miniconda3
, but you can choose a different location if needed.conda init
. It’s a good idea to type yes
so that Conda is automatically set up in your shell profile (e.g., .bashrc
).If you skipped the initialization step during installation or if you want to make sure Conda is properly configured, you can manually initialize it by running:
conda init
This command configures your shell to activate Conda by default. You may need to restart your SSH session or source your .bashrc
file for the changes to take effect:
source ~/.bashrc
Once you’ve initialized Conda, you can verify that the installation was successful by checking the Conda version:
conda --version
If the installation was successful, this command will output the version of Conda installed on your system.
It’s always a good idea to keep your software up to date. You can update Conda to the latest version by running:
conda update conda
Confirm the update when prompted, and Conda will update itself to the latest version.
Now that Conda is installed, you can start creating isolated environments to manage different projects and their dependencies.
To create a new environment, run:
conda create --name myenv python=3.8
This will create a new environment named myenv
with Python 3.8. You can activate the environment with:
conda activate myenv
To deactivate the environment, simply run:
conda deactivate
To install additional packages, you can use the conda install
command. For example, to install numpy
in your current Conda environment, run:
conda install numpy
You can also install packages from specific channels, like conda-forge
, using the -c
option:
conda install -c conda-forge pandas
Installing Conda on an SSH server is a simple and efficient way to manage Python environments and packages remotely. By following the steps above, you’ll have a working Conda installation on your server, enabling you to create environments, install packages, and more, all from the command line. Whether you’re working on a data science project or managing complex dependencies, Conda will help streamline your workflows on a remote machine. Happy coding!