Vast.AI SetUp

Vast.ai Host Setup Guide โ€” Rabid Mining
โšก Rabid Mining

VAST.AI HOST
SETUP GUIDE

Get your NVIDIA GPU online and earning on Vast.ai โ€” beginner friendly, fully automated.

NVIDIA GPUs ONLY Ubuntu 22.04 / 24.04 Auto-Resume After Reboot
โš ๏ธ
Create a SEPARATE Vast.ai Host Account! Do NOT use your client account for hosting. Go to cloud.vast.ai, create a new account, then go to Setup in the left sidebar and accept the hosting agreement before running the script.
๐Ÿ”‘
The install key is NOT your API key! The script needs the special install key from cloud.vast.ai/host/setup โ€” it’s in the install command on that page. It expires after 1 hour. This is different from the API key under Account โ†’ API Keys.
๐ŸŽฎ
GPU
NVIDIA only. RTX 3000+ series recommended for best earnings.
MIN: GTX 1000 series (Pascal)
๐Ÿง 
CPU
At least 2 hyperthreads per GPU with AVX support.
MIN: 1 physical core per GPU
๐Ÿ’พ
RAM
8GB+ per GPU recommended for smooth operation.
MIN: 4GB per GPU
๐Ÿ’ฟ
Storage
Fast SSD. Separate drive for Docker gives best performance.
MIN: 128GB SSD per GPU
๐ŸŒ
Network
500 Mbps+ up/down recommended. Required for verification.
MIN: 10 Mbps per machine
๐Ÿ”Œ
Ports
100 open ports per GPU recommended for more rentals.
MIN: 3 open ports per GPU
๐Ÿ’ฟ
Partition Your Drive for Best Performance
Vast.ai needs a separate XFS partition for Docker โ€” set this up during Ubuntu install
โš ๏ธ If you only have one drive: Vast.ai will create a loopback XFS partition automatically โ€” this works but has lower performance. For best results use two drives or partition during Ubuntu install.

The recommended partition layout when installing Ubuntu:

PartitionSizeFormatMount PointPurpose
/dev/sda1256MB+FAT32/boot/efiEFI boot
/dev/sda280GB+ext4/Ubuntu + Vast.ai software
/dev/sdb1RESTXFS/var/lib/dockerDocker containers (best performance)
During Ubuntu install: Leave your second drive/remaining space unpartitioned. The Vast.ai installer will automatically detect it, format it as XFS, and mount it at /var/lib/docker. If no free space exists it uses a loopback device instead.
๐Ÿ’ฟ
Want Ubuntu to Install Itself Automatically?
Create a USB that installs Ubuntu with the perfect Vast.ai partition layout โ€” completely hands-free. Boot it, walk away, SSH in and run one command. No clicking through the installer at all.
💾 Ubuntu Auto-Install USB Guide →
Supports Ubuntu 22.04 & 24.04  ยท  Works on Windows  ยท  Correct Vast.ai partition layout baked in
๐Ÿ–ฅ๏ธ
Ubuntu Server โ€” Click to Download
Server edition only โ€” no Desktop version.
๐ŸŽฎ
NVIDIA GPU
Any NVIDIA card GTX 1000+ works. AMD GPUs are NOT supported by Vast.ai.
๐ŸŒ
Stable Internet
Wired connection strongly recommended. You need router access to forward ports.
๐Ÿ”‘
Vast.ai Host Account
Sign up at cloud.vast.ai/?ref_id=563718 โ€” accept hosting agreement in Setup before running script.
๐Ÿ–ฅ
SSH Into Your Rig From Another PC
Control your rig remotely โ€” no monitor, keyboard or mouse needed after this
What is SSH? It lets you type commands into your mining rig from your laptop or desktop. Once set up you can unplug the monitor and keyboard from the rig forever.
โ–ธ STEP A โ€” FIND YOUR RIG’S IP

While still plugged into the rig, type:

ON THE RIG
hostname -I

You’ll see something like 192.168.1.105 โ€” write it down.

๐Ÿ’ก ALTERNATIVE โ€” FIND IT IN YOUR ROUTER

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.

โ–ธ STEP A2 โ€” NAME YOUR RIG (OPTIONAL)
REPLACE rig1 WITH YOUR NAME
sudo hostnamectl set-hostname rig1 && sudo reboot

Shows in your router list and Vast.ai dashboard. Use lowercase, numbers and hyphens only.

โ–ธ STEP B โ€” OPEN A TERMINAL ON YOUR OTHER PC
๐ŸชŸ WINDOWS
Press Win+R, type cmd, hit Enter.
OR search PowerShell in Start menu.
๐ŸŽ MAC
Press Cmd+Space, type Terminal, hit Enter.
โ–ธ STEP C โ€” SSH INTO YOUR RIG
YOUR OTHER PC
ssh yourusername@192.168.1.XXX
yourusername
The username you set during Ubuntu install
192.168.1.XXX
The IP from Step A above
โ–ธ STEP D โ€” ACCEPT & LOG IN
First time it asks: 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 key conflict after reinstall? Run: ssh-keygen -R 192.168.1.72 then SSH again.
โšก Fastest Option โ€” One Command Does Everything
Paste This In Your Terminal & Walk Away
wget -O vastai-setup.sh https://rabidmining.com/vastai-setup.sh && sudo bash vastai-setup.sh
Get your install key from cloud.vast.ai/host/setup โ€” expires after 1 hour  ยท  Script auto-reboots and resumes โ€” nothing to do!  ยท  Takes 15-30 mins total
โœ” Step 1
Cleans apt sources, removes Snap, forces IPv4, updates system
โœ” Step 2
Installs all essential tools and packages
โœ” Step 3
Detects NVIDIA GPU โ€” stops if no NVIDIA found
โœ” Step 4
Installs NVIDIA driver โ€” auto reboots & resumes
โœ” Step 5
Installs Docker CE via official repo
โœ” Step 6
Installs NVIDIA Container Toolkit
โœ” Step 7
Installs Vast.ai daemon with auto port setup
โœ” Step 8
Enables GPU persistence, disables auto-updates
โฑ TIMING โ€” DO THIS WHILE THE SCRIPT RUNS

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!

โœ˜ WRONG
Account โ†’ API Keys โ€” this is for the CLI tool, NOT for the installer script. Using this will give you a 403 error.
โœ” RIGHT
Host โ†’ Setup page โ€” this is the install key embedded in the command shown on that page. Copy just the long hex string from it. Expires after 1 hour!
HOW TO GET YOUR INSTALL KEY:
  1. Log into your HOST account at cloud.vast.ai
  2. Click Setup in the left sidebar
  3. Accept the hosting agreement if prompted
  4. Scroll to “Install Manager” section
  5. You’ll see a command like: wget ... sudo python3 install YOURKEY --interactive
  6. Copy that long hex key and paste it into the one-liner above
  7. If you get a 403 error โ€” re-accept the hosting agreement, refresh the page, get a new key
7
Forward Ports on Your Router
Required for renters to connect to your GPU
โฑ DO THIS WHILE THE SCRIPT IS RUNNING!

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

  1. Find your rig’s local IP: type hostname -I on the rig
  2. Open a browser โ†’ go to 192.168.1.1 or 192.168.0.1
  3. Log in (check the sticker on your router for credentials)
  4. Find Port Forwarding (under “Advanced” or “NAT”)
  5. Add rule: Port range 40000-40100 โ†’ your rig’s local IP (TCP + UDP)
  6. Save and apply
Already using 16384-32768? Use 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.
๐Ÿ”„
Final Reboot After the script prints โœ… ALL DONE, do one final reboot: sudo reboot
๐Ÿ’ฐ
Set Your Pricing Go to cloud.vast.ai โ†’ Machines โ†’ Settings โ†’ List. Check what similar GPUs charge to stay competitive.
โœ…
Watch Verification Stages Vast.ai runs automated tests โ€” takes 10-30 mins. Higher verification = more rentals. Don’t reboot during this!
๐Ÿ”’
Auto-Updates Already Disabled The script already disabled unattended-upgrades so Ubuntu won’t silently update your NVIDIA drivers and break things.
๐Ÿ“Š
Track Earnings View payouts at cloud.vast.ai โ†’ Earnings. Payouts via crypto or credits.
โ“ Getting a 403 Forbidden error?
You’re using the wrong key OR the hosting agreement isn’t accepted. Go to cloud.vast.ai/host/setup, accept the agreement, refresh the page, and copy a fresh install key. Keys expire after 1 hour so always get a new one.
โ“ Machine not showing up on dashboard?
Wait 5-10 minutes and refresh. Check ports are forwarded using portchecker.co. If still missing: sudo systemctl status vastai โ€” should say active (running).
โ“ Docker packages not found during install?
IPv6 issue โ€” the script now forces IPv4 automatically. If it still fails run: echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4 then re-run the script.
โ“ Script says it already ran but machine isn’t set up?
Progress files exist from a previous run. Reset with: sudo rm -rf /var/lib/vastai-setup then re-run the full script from scratch.
โ“ NVML error in logs?
sudo reboot fixes 99% of NVML errors. Happens when the driver loaded but kernel module didn’t initialize correctly.
โ“ SSH key conflict after reinstall?
Run ssh-keygen -R 192.168.1.72 (use your rig’s IP) on your Windows/Mac PC, then SSH in again normally.
โ“ Need more help?
Join the Vast.ai Discord โ€” hosts-only channel has people who’ve seen everything. Also drop a comment on the Rabid Mining YouTube video!
Rabid Mining โ€” GPU Rental & Crypto Mining Guides
Vast.ai  ยท  Vast.ai Docs  ยท  Vast.ai Discord
Script and guide by Rabid Mining. Always verify scripts before running them.
๐Ÿ’› SUPPORT RABID MINING
โ‚ฟ BTC: bc1qzsadu3p5s6gs9cpw9aa9uzsvjzj8y5nmrqs6c5
ล LTC: ltc1qk0fy0d7g9ttfcyh4yrk0m75jcnpqyykgphlzsd