Last active
July 11, 2025 16:56
-
-
Save texasdave2/1d22de16b7ce08f03694eb6334d3cd16 to your computer and use it in GitHub Desktop.
ubuntu setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt upgrade | |
### common tools | |
sudo apt-get install git git-lfs tree net-tools nvtop speedtest-cli | |
# Add Docker's official GPG key: | |
sudo apt-get update | |
sudo apt-get install ca-certificates curl | |
sudo install -m 0755 -d /etc/apt/keyrings | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
sudo chmod a+r /etc/apt/keyrings/docker.asc | |
# Add the repository to Apt sources: | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update | |
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
sudo usermod -aG docker demo | |
exit / login for ^^^ to take effect | |
#### container toolkit | |
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ | |
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ | |
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ | |
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list | |
sudo apt-get update | |
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1 | |
sudo apt-get install -y \ | |
nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \ | |
nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \ | |
libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \ | |
libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION} | |
sudo vi /etc/docker/daemon.json | |
{ | |
"runtimes": { | |
"nvidia": { | |
"path": "nvidia-container-runtime", | |
"runtimeArgs": [] | |
} | |
} | |
} | |
sudo systemctl restart docker | |
### nvidia gpu drivers | |
ubuntu-drivers devices | |
sudo apt install nvidia-driver-570 | |
sudo reboot | |
#### if you lose the wifi adapter after docker install, try docker network prune and then reboot. | |
### install jupyter | |
sudo apt install python3 python3-pip python3-dev build-essential -y | |
sudo apt install python3-venv -y | |
python3 -m venv jupyter_env | |
source jupyter_env/bin/activate | |
vi ~/.bashrc | |
source jupyter_env/bin/activate | |
pip install jupyter | |
jupyter --version | |
jupyter notebook --generate-config | |
jupyter notebook password | |
vi ~/.jupyter/jupyter_notebook_config.py | |
c.ServerApp.ip = '0.0.0.0' | |
c.ServerApp.port = 8888 | |
sudo vi /etc/systemd/system/jupyter.service | |
[Unit] | |
Description=Jupyter-Notebook Daemon | |
[Service] | |
Type=simple | |
ExecStart=/bin/bash -c "/home/demo/jupyter_env/bin/jupyter-notebook --no-browser --notebook-dir=/home/demo" | |
WorkingDirectory=/home/demo | |
User=demo | |
Group=demo | |
PIDFile=/run/jupyter-notebook.pid | |
Restart=on-failure | |
RestartSec=60s | |
[Install] | |
WantedBy=multi-user.target | |
sudo systemctl daemon-reload | |
sudo systemctl start jupyter | |
sudo systemctl enable jupyter | |
sudo systemctl status jupyter | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment