Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration

Introduction

Anaconda is an open-source distribution platform that bundles Python, the conda package manager, and essential libraries like NumPy, pandas, and scikit-learn. It streamlines environment management and ensures consistency across …


This content originally appeared on DEV Community and was authored by Joy Akinyi

Introduction

Anaconda is an open-source distribution platform that bundles Python, the conda package manager, and essential libraries like NumPy, pandas, and scikit-learn. It streamlines environment management and ensures consistency across team projects. By deploying Anaconda with JupyterLab on an Azure Virtual Machine (VM) running Ubuntu, teams can create a cloud-based, collaborative workspace.

This guide walks you through setting up an Azure VM with Ubuntu, installing Anaconda, configuring JupyterLab for team access on port 8888, and testing the setup with a sample project.

Prerequisites

  • An Azure subscription (sign up for a free account at azure.microsoft.com/free) or better still, a student account
  • Familiarity with Linux terminal commands.
  • Sudo privileges on the VM.

Step 1: Set Up an Azure VM with Ubuntu

  1. Log in to the Azure portal at portal.azure.com. or use a student account to log in.
  2. Navigate to Virtual machines under Services and select Create > Virtual machine.
  3. In the Basics tab:

    • Choose your subscription.
    • Create a new resource group (e.g., myResourceGroup).
    • Name the VM (e.g., myVM).
    • Select a region close to your team for low latency.
    • Choose Ubuntu Server 22.04 LTS - Gen2 as the Image.
  4. Under Administrator account:

    • Select SSH public key or Password for authentication.
    • Set a username (e.g., azureuser).
    • Provide an SSH key or password as needed.
  5. In Inbound port rules, allow SSH (22) and Custom TCP (8888) for JupyterLab access.

    • To allow port 8888:
      • After VM creation, go to the VM’s Networking tab in the Azure portal.
      • Click Add inbound port rule.
      • Set Service to Custom, Port ranges to 8888, Protocol to TCP, and Action to Allow.
      • For security, restrict Source to your team’s IP ranges.
  6. Review and create the VM, saving the SSH key if generated.

  7. Note the public IP address from the VM’s overview page.

Connect to the VM via SSH: ssh azureuser@<public-ip> (add -i path/to/key.pem for key-based authentication).

Step 2: Install Anaconda on the Ubuntu VM

  • Update the system:
   sudo apt update && sudo apt upgrade -y
  • Install required utilities:
   sudo apt install wget curl git -y
  • Download the latest Anaconda installer:
   wget https://repo.anaconda.com/archive/Anaconda3-2025.06-1-Linux-x86_64.sh
  • Verify the installer (optional):
   sha256sum Anaconda3-2025.06-1-Linux-x86_64.sh

Compare the checksum with the official value from Anaconda’s website.

  • Run the installer:
   #Default is ~/anaconda3, but you can change it to /opt/anaconda3 for system-wide use.
   bash Anaconda3-2025.06-1-Linux-x86_64.sh

Accept the license and install in a shared location like /opt/anaconda3 for team access.

  • Set permissions:
   #ensures the 'users' group has control of Anaconda’s directory.
   sudo chown -R :users /opt/anaconda3
   #allows all users in the 'users' group to install/update packages without sudo
   sudo chmod -R g+w /opt/anaconda3
  • Initialize conda:
    #Initialize conda for your shell
   /opt/anaconda3/bin/conda init
    # Reload your shell configuration file
   source ~/.bashrc
  • Verify the installation:
   conda --version
   python --version
  • Create a shared conda environment:
   conda create --name teamenv python=3.11
   conda activate teamenv

Step 3: Configure a Secure JupyterLab Server

JupyterLab is configured on port 8888 with a password to secure access, ensuring only authorized team members can log in.

  • Install JupyterLab:

    conda activate teamenv
    conda install jupyterlab
    
  • Generate a configuration file:

    jupyter lab --generate-config
    
  • Set a password to secure the server:

    from jupyter_server.auth import passwd
    passwd()
    

    Enter a password (e.g., mysecurepassword) and copy the sha1:... hash. This password is critical to prevent unauthorized access to http://<public-ip>:8888.

  • Edit ~/.jupyter/jupyter_lab_config.py:

   c.ServerApp.ip = '0.0.0.0'  # Allow access from any IP
   c.ServerApp.port = 8888     # Default port
    c.ServerApp.open_browser = False
   c.ServerApp.password = 'sha1:<hashed-password>'  # Paste the hashed password
   c.ServerApp.allow_remote_access = True
   c.ServerApp.root_dir = '/opt/shared_notebooks'  # Shared directory
  • Create a shared notebook directory:
   #create a directory
   sudo mkdir /opt/shared_notebooks
   # give ownership to the users group
   sudo chown azureuser:users /opt/shared_notebooks
   # give groups write rights in the notebook
   sudo chmod g+w /opt/shared_notebooks

Note: If you want all users who run JupyterLab to access this folder, you need to make sure they’re added to the users group.:

sudo usermod -aG users <username>
  • Start JupyterLab in the background:
   conda activate teamenv
   nohup jupyter lab 

The nohup command ensures JupyterLab continues running after you exit the SSH session, maintaining access at http://:8888.
Access JupyterLab at http://<public-ip>:8888 and log in with the password. Use HTTPS if configured.

Collaboration Notes:

  • Users share the teamenv environment and /opt/shared_notebooks.
  • Add team members to the users group (e.g., sudo adduser teamuser1; sudo usermod -aG users teamuser1) and share the password securely.
  • Avoid conflicts by using Git or subdirectories in /opt/shared_notebooks.

Step 4: Test with a Mini Project

Test with a JupyterLab notebook fetching cryptocurrency data from CoinGecko.

Install dependencies:

   conda activate teamenv
   conda install requests pandas

Create a notebook in /opt/shared_notebooks and add:



   import requests
   import pandas as pd
   from datetime import datetime

   url = "https://api.coingecko.com/api/v3/coins/markets"
   params = {
       "vs_currency": "usd",
       "ids": "bitcoin,ethereum,cardano,solana",
       "order": "market_cap_desc",
       "per_page": 10,
       "page": 1,
       "sparkline": False
   }

   response = requests.get(url, params=params)
   if response.status_code == 200:
       data = response.json()
       df = pd.DataFrame(data, columns=["id", "symbol", "current_price", "market_cap", "total_volume"])
       df["timestamp"] = datetime.now()
       display(df)
   else:
       print("Error fetching data:", response.status_code)

Run and share the notebook via /opt/shared_notebooks or Git.


This content originally appeared on DEV Community and was authored by Joy Akinyi


Print Share Comment Cite Upload Translate Updates
APA

Joy Akinyi | Sciencx (2025-08-26T14:24:04+00:00) Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration. Retrieved from https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/

MLA
" » Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration." Joy Akinyi | Sciencx - Tuesday August 26, 2025, https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/
HARVARD
Joy Akinyi | Sciencx Tuesday August 26, 2025 » Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration., viewed ,<https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/>
VANCOUVER
Joy Akinyi | Sciencx - » Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/
CHICAGO
" » Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration." Joy Akinyi | Sciencx - Accessed . https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/
IEEE
" » Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration." Joy Akinyi | Sciencx [Online]. Available: https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/. [Accessed: ]
rf:citation
» Deploying Anaconda with JupyterLab on an Azure VM for Team Collaboration | Joy Akinyi | Sciencx | https://www.scien.cx/2025/08/26/deploying-anaconda-with-jupyterlab-on-an-azure-vm-for-team-collaboration/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.