VAST.AI HOST
SETUP GUIDE
Get your NVIDIA GPU online and earning on Vast.ai โ beginner friendly, fully automated.
The recommended partition layout when installing Ubuntu:
| Partition | Size | Format | Mount Point | Purpose |
|---|---|---|---|---|
| /dev/sda1 | 256MB+ | FAT32 | /boot/efi | EFI boot |
| /dev/sda2 | 80GB+ | ext4 | / | Ubuntu + Vast.ai software |
| /dev/sdb1 | REST | XFS | /var/lib/docker | Docker containers (best performance) |
While still plugged into the rig, type:
hostname -I
You’ll see something like 192.168.1.105 โ write it down.
Log into your router at 192.168.1.1 or 192.168.0.1 โ look for Connected Devices or DHCP Clients โ find your rig’s name โ copy the IP next to it.
๐ก Pro tip: Set a DHCP Reservation so your rig always gets the same IP.
sudo hostnamectl set-hostname rig1 && sudo reboot
Shows in your router list and Vast.ai dashboard. Use lowercase, numbers and hyphens only.
cmd, hit Enter.OR search PowerShell in Start menu.
Terminal, hit Enter.ssh yourusername@192.168.1.XXX
Are you sure you want to continue connecting (yes/no)? โ type yes. Then enter your Ubuntu password. You won’t see it as you type โ that’s normal.ssh-keygen -R 192.168.1.72 then SSH again.wget -O vastai-setup.sh https://rabidmining.com/vastai-setup.sh && sudo bash vastai-setup.sh
Cleans apt sources, removes Snap, forces IPv4, updates system
Installs all essential tools and packages
Detects NVIDIA GPU โ stops if no NVIDIA found
Installs NVIDIA driver โ auto reboots & resumes
Installs Docker CE via official repo
Installs NVIDIA Container Toolkit
Installs Vast.ai daemon with auto port setup
Enables GPU persistence, disables auto-updates
Step 7 (Vast.ai installer) takes 10-20 minutes while it pulls Docker images and runs GPU tests. This is the perfect time to forward your ports on the router! Don’t wait until after โ do it now while you’re waiting.
โ ๏ธ THERE ARE TWO DIFFERENT KEYS โ DON’T MIX THEM UP!
- Log into your HOST account at cloud.vast.ai
- Click Setup in the left sidebar
- Accept the hosting agreement if prompted
- Scroll to “Install Manager” section
- You’ll see a command like:
wget ... sudo python3 install YOURKEY --interactive - Copy that long hex key and paste it into the one-liner above
- If you get a 403 error โ re-accept the hosting agreement, refresh the page, get a new key
The Vast.ai installer (Step 7) takes 10-20 minutes. Forward your ports during that time so everything is ready when the script finishes.
๐ก Port Forwarding Instructions
- Find your rig’s local IP: type
hostname -Ion the rig - Open a browser โ go to
192.168.1.1or192.168.0.1 - Log in (check the sticker on your router for credentials)
- Find Port Forwarding (under “Advanced” or “NAT”)
- Add rule: Port range
40000-40100โ your rig’s local IP (TCP + UDP) - Save and apply
40000-40100 or any free continuous range. 100 ports per GPU is recommended. You can use any range โ the script pre-configures 40000-40100 automatically.
sudo reboot
sudo systemctl status vastai โ should say active (running).echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4 then re-run the script.sudo rm -rf /var/lib/vastai-setup then re-run the full script from scratch.sudo reboot fixes 99% of NVML errors. Happens when the driver loaded but kernel module didn’t initialize correctly.ssh-keygen -R 192.168.1.72 (use your rig’s IP) on your Windows/Mac PC, then SSH in again normally.