From d46dfbb648b00506f4ae439f9d9661f725c30d25 Mon Sep 17 00:00:00 2001 From: medusa Date: Sun, 12 May 2024 03:47:04 +0000 Subject: [PATCH] Update tech_docs/linux/conda_install.md --- tech_docs/linux/conda_install.md | 51 +++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/tech_docs/linux/conda_install.md b/tech_docs/linux/conda_install.md index 47d1e8b..90011e0 100644 --- a/tech_docs/linux/conda_install.md +++ b/tech_docs/linux/conda_install.md @@ -1,6 +1,6 @@ -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. +Certainly! I'll review the entire conversation and compare it with the attached document to build out a comprehensive step-by-step guide for setting up Conda and JupyterLab on a Debian 12 server. I'll include the additional details we've discussed, such as saving the `environment.yml` file, not launching Conda by default, and other helpful items. -Here's a consolidated guide that combines the steps for installing Conda and setting up JupyterLab on a Debian 12 server: +Here's the complete and refined guide: # Setting up Conda and JupyterLab on a Debian 12 Server @@ -33,14 +33,21 @@ chmod +x Miniconda3-latest-Linux-x86_64.sh ./Miniconda3-latest-Linux-x86_64.sh ``` +During the installation, when prompted to choose whether to initialize Conda, enter "no" to prevent Conda from automatically launching on shell startup. + ## Step 5: Initialize Conda ```bash +eval "$(/home/medusa/miniconda3/bin/conda shell.bash hook)" +conda init source ~/.bashrc -conda --version -conda init bash +conda config --set auto_activate_base false ``` +Replace `your_username` with your actual username. + +The `conda config --set auto_activate_base false` command prevents Conda from automatically activating the base environment on shell startup. + ## Step 6: Create a Conda environment ```bash @@ -75,24 +82,48 @@ c.ServerApp.open_browser = False jupyter lab password ``` -## Step 10: Start JupyterLab +## Step 10: Save the environment configuration + +```bash +conda env export > environment.yml +``` + +This command saves the current environment's configuration, including the installed packages and their versions, to a file named `environment.yml`. + +## Step 11: Start JupyterLab ```bash jupyter lab ``` -## Step 11: Access JupyterLab +## Step 12: 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 +## Step 13: Deactivate the environment when done ```bash conda deactivate ``` -Remember to replace `myenv` with your desired environment name and adjust the Python version and package list according to your requirements. +## Additional Notes -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. +- To recreate the environment on another machine or share it with others, use the `environment.yml` file: -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. \ No newline at end of file + ```bash + conda env create -f environment.yml + ``` + +- 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. + +- Remember to replace `myenv` with your desired environment name and adjust the Python version and package list according to your requirements. + +- If you need to make the `conda` command available in your shell after the Miniconda installation, run: + + ```bash + eval "$(/home/medusa/miniconda3/bin/conda shell.bash hook)" + ``` + + Replace `medusa` with your actual username. + +This comprehensive guide includes all the necessary steps to set up Conda and JupyterLab on a Debian 12 server, along with additional details on saving the environment configuration, not launching Conda by default, and other helpful tips. You can store this guide on GitHub as a reference for future use. \ No newline at end of file