Files
the_information_nexus/tech_docs/linux/conda_install.md

2.7 KiB

Apologies for the confusion. I'll now review the document you provided and include the relevant steps for setting up JupyterLab on a headless server.

Here's a consolidated guide that combines the steps for installing Conda and setting up JupyterLab on a Debian 12 server:

Setting up Conda and JupyterLab on a Debian 12 Server

Step 1: Update your system

sudo apt update && sudo apt upgrade

Step 2: Install required dependencies

sudo apt install wget gpg python3 python3-pip

Step 3: Download and verify the Miniconda installer

cd ~/Downloads
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh.sha256
sha256sum Miniconda3-latest-Linux-x86_64.sh
cat Miniconda3-latest-Linux-x86_64.sh.sha256

Step 4: Install Miniconda

chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh

Step 5: Initialize Conda

source ~/.bashrc
conda --version
conda init bash

Step 6: Create a Conda environment

conda create --name myenv python=3.12
conda activate myenv

Step 7: Install JupyterLab and other packages within the environment

python3 -m pip install --upgrade pip
python3 -m pip install jupyterlab numpy pandas matplotlib

Step 8: Configure JupyterLab for remote access

jupyter lab --generate-config

Open the jupyter_lab_config.py file located in ~/.jupyter/ and uncomment the following lines, making sure to set your desired IP address and port:

c.ServerApp.ip = '0.0.0.0'  # Set to your server's IP or '0.0.0.0' for all interfaces
c.ServerApp.port = 8888  # Set to your desired port
c.ServerApp.open_browser = False

Step 9: Set a password for JupyterLab

jupyter lab password

Step 10: Start JupyterLab

jupyter lab

Step 11: Access JupyterLab

From your local machine, open a web browser and navigate to http://your_server_ip:8888. Replace your_server_ip with your server's IP address or hostname, and 8888 with the port you configured in step 8 if you changed it.

Step 12: Deactivate the environment when done

conda deactivate

Remember to replace myenv with your desired environment name and adjust the Python version and package list according to your requirements.

Note: For added security, consider using SSH tunneling, configuring a reverse proxy with SSL encryption, or employing firewall rules to restrict access to your JupyterLab instance.

This guide combines the steps for installing Conda, setting up a Conda environment, and configuring JupyterLab to run on a Debian 12 server, accessible remotely from your local machine.