How to Install and Run runpodctl to control a runpod.io pod

If you’ve checked out runpod.io lately for AI or GPU work, then you may have run into mention of runpodctl. Here is a “quickstart” guide to help get you set up.

runpod.io….it’s the f𝕦𝕥𝕦𝕣𝕖….

For reference, It’s currently March 2023 and I’m on Ubuntu 22.04.2 LTS, so these commands will be in Linux. As you have probably guessed, Windows and Mac users might need to modify the commands.

Installing runpodctl

Follow the instructions listed in the GitHub README. For Ubuntu, this was:

wget --quiet --show-progress https://github.com/Run-Pod/runpodctl/releases/download/v1.9.0/runpodctl-linux-amd -O runpodctl && chmod +x runpodctl && sudo cp runpodctl /usr/bin/runpodctl

And now verify that you have runpodctl installed:

$ runpodctl version
runpodctl v1.9.0

Sweet! Pretty straightforward.

VPN Issue

Note, that if you’re behind a VPN (with a sluggish Internet), you may experience go requests failing. For reference, the error looks like this:

Error: Post "https://api.runpod.io/graphql?api_key=API_KEY": context deadline excee
ded (Client.Timeout exceeded while awaiting headers)

(The API_KEY, I explain later on)

I found the only way around this was to increase the timeout in the go code. As of the 25th, I did submit a PR to solve this. It may or may not get merged in by the time of reading. If it hasn’t been merged, you’ll need to install runpodctl from source.

First, install go.

Once go’s installed, run the following commands:

git clone git@github.com:src-r-r/runpodctl.git -b bugfix/go-posting-issue
cd runpodctl
go get

Now instead of runpdoctl you’ll need to run go run main.go within this directory.

Authenticating

Runpod.io uses standard API key authentication. To get started, go to runpod.io, log in, go to your settings, and scroll down to where it says API Keys. Click + API Key to add a new API key. Make sure to copy the value to your password manager so you don’t forget it.

Runpod API Key — Copy this Value!

Now, configure runpodctl to use the API key (replacing API_KEY with the actual value, of course)

$ runpodctl config --apiKey API_KEY

You should see a notice about your API key being stored.

Running runpodctl

Now you should be authenticated. You can check out runpodctl’s command line with runpodctl --help :

$ runpodctl --help
runpodctl is a CLI tool to manage your pods for runpod.io

Usage:
runpodctl [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
config CLI Config
create create a resource
get get resource
help Help about any command
receive receive file(s), or folder
remove remove a resource
send send file(s), or folder
start start a resource
stop stop a resource
version runpodctl version

Flags:
-h, --help help for runpodctl

Use "runpodctl [command] --help" for more information about a command.

For example, to create a pod from a template…

$ runpodctl create pod --volumeSize 120 --containerDiskSize 120 --secureCloud --name <pod-name> --gpuType 'NVIDIA RTX A4000' --imageName <image-name>                       
pod "4yun8pgw7v13d0" created for $0.340 / hr

Conclusion

This article outlines how to install and use the runpodctl on an Ubuntu system. Please modify according to your needs and your OS.

Have fun podding!

👉‍‍ Did you like this article? Share it with 3 of your friends or colleagues?

📢 Comment below: What do you use your runpod.io pod for?

💓 Subscribe to DamnGoodTech on Ko-Fi. Help support more of these articles.

🤝🏼 Hire Me as a lead dev on your team.

--

--

Jordan H (Principal, Damn Good Tech) #openforwork

Senior Full Stack Developer & Tech Lead (#openforwork)