Install and Configure SSH and Jupyter for Custom Images
Learn how to configure SSH service and JupyterLab for nvcr.io/nvidia/pytorch:25.04-py3 image in Dev Pod
This example shows you how to configure SSH service and JupyterLab for a custom Docker image nvcr.io/nvidia/pytorch:25.04-py3 when using Dev Pod.
This PyTorch image doesn't come with SSH service and JupyterLab pre-configured, so manual setup is required for remote access and JupyterLab.
Step 1: Prepare the Setup Script
Create a setup script that will install and configure SSH service and JupyterLab on your PyTorch container. Here's the complete script template:
Configuration Parameters
Before running the script, configure the following parameters:
SSHPUB: Your SSH public key (e.g.,ssh-rsa AAAxxxxx lepton@sampleDomain.com)JUPKEY: Your JupyterLab token (optional, leave empty to skip JupyterLab installation)
Step 2: Create Dev Pod with PyTorch Image
- Navigate to Dev Pod Creation: Go to the Dev Pod creation page in your DGX Cloud Lepton dashboard.
- Select Custom Image: In the container configuration section, select custom image and input the image name
nvcr.io/nvidia/pytorch:25.04-py3. - Create the Pod: Complete the pod creation with your desired resource configuration.
Step 3: Run the Setup Script
- Open the Web Terminal: Navigate to your Pod details page and switch to the "Terminal" tab.
- Execute the Script: Copy the configured script from Step 1, paste it into the terminal, and press
Enter. - Wait for Completion: The script will automatically:
- Install and configure SSH service on the PyTorch container
- Set up SSH keys and authentication
- Install and configure JupyterLab (if token provided)
- Start the services
Step 4: Verify the Configuration
Verify SSH Setup
After the script completes successfully, verify that SSH is properly configured:
- Check SSH Directory: Ensure the
.sshdirectory exists in the root directory - Check Authorized Keys: Verify that the
authorized_keysfile is present and contains your public key - Test Connection: Use the SSH connection command from the Pod details page under the "Connect" tab
Verify JupyterLab
If you configured JupyterLab:
- Check Process: Verify that JupyterLab is running with
pgrep jupyter-lab - Check Logs: View JupyterLab logs at
/var/log/jupyter.log - Access Interface: Connect to JupyterLab through the Pod's network interface on port 18889
Verify PyTorch Environment
Once connected via SSH, you can verify the PyTorch environment:
What This Example Achieves
By following this example, you will have:
- A fully configured SSH service on the PyTorch 25.04-py3 container
- Key-based SSH authentication
- JupyterLab running on port 18889 (optional)
- Proper environment variable exposure for SSH sessions
- Access to the complete PyTorch development environment
- Security configurations optimized for container environments
This setup enables you to remotely access your PyTorch Dev Pod for machine learning development, model training, and interactive computing tasks with the full power of the NVIDIA PyTorch container.