# Rent a GPU with your own Docker image and a start command

> Run any public Docker image on a rented GPU with a start command — on the website in Pro mode, or through the API and the gpurent CLI.

Source: https://rentgpupower.com/guides/rent-a-gpu-with-your-own-docker-image — updated 2026-11-10 — RentGPUPower

The ready-made environments — PyTorch with JupyterLab, Ollama, vLLM and others — cover the common cases. When you have your own stack, run any public Docker image instead, with a command that runs once, first, when the rental starts: the same idea as Vast's "onstart".

## On the website

1. Turn on **Pro mode** with the switch in the header.
2. Choose a GPU on the [marketplace](https://rentgpupower.com/market) and go to checkout.
3. Open **Your own Docker image** and type the image: `pytorch/pytorch:latest`, `nvidia/cuda:12.4.1-runtime-ubuntu22.04`, `ghcr.io/you/your-image:1.0`…
4. Optionally, add a start command under **Run when it starts**.
5. Press **Use this image**, then pay.

A start command can install what your work needs and check the GPU, for example:

```bash
pip install transformers accelerate datasets && python -c "import torch; print(torch.cuda.get_device_name())"
```

Its output appears in the **Console** on the rental page. From there, work in the browser terminal or [over SSH](https://rentgpupower.com/guides/ssh-into-a-rented-gpu).

The image and start command are set at checkout and can only be changed before you pay; **Use the environment above instead** switches back to a ready-made environment.

## What to expect inside

- **The image needs `sh`.** Nearly every Linux image has it.
- **Your files live in /workspace**, kept across commands for the whole rental and deleted when it ends — save what matters to your computer or to My Drive. On the website, **Keep my files after this rental** can keep /workspace on that machine for your next rental there instead, for $0.15 per GB a month ([how](https://rentgpupower.com/guides/keep-your-files-between-rentals)); everything outside it starts afresh from your image. An API instance's files always go.
- **The image's own start-up does not run.** The container starts with a shell and waits for your commands; its ENTRYPOINT and CMD are skipped. Put whatever must happen first into the start command.
- **The start command has up to an hour to finish**, so use it for setup. Start a long-running server from the terminal or over SSH, with `nohup … &` so it keeps running after you disconnect.
- **The first download of your image on a machine is not billed** — up to its first 15 minutes. An image too big for the machine's free disk is refused with a message — choose a smaller one, or a machine with more free disk (every listing shows it).
- **Public images from a big registry:** Docker Hub, GitHub (ghcr.io), Quay, NVIDIA NGC (nvcr.io), AWS (public.ecr.aws), Google (gcr.io, pkg.dev), GitLab or Microsoft (mcr.microsoft.com) — none that needs a login. Another registry is refused: one run for the purpose could answer the host's download with something that harms their computer.
- **Privacy:** your image and your start command run on the host's computer, like everything you send it, so a host could look. Keep passwords and long-lived keys out of the start command — use short-lived keys you can cancel.
- **Some machines cannot take your own image:** one whose container software is out of date runs only the ready environments — checkout says so before you pay.

## Choosing an image

- **Pin a version.** `pytorch/pytorch:2.4.0-cuda12.4-cudnn9-runtime` gives every rental the same software; `latest` can change under you. On an RTX 50-series card, pick a build for CUDA 12.8 or newer, such as `pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime`: PyTorch 2.4 has no code for those cards. The machine's driver must run your image's CUDA: on the [marketplace](https://rentgpupower.com/market), More filters → **Min CUDA version** (12.8 for that image) shows only those machines.
- **Smaller starts sooner.** The machine downloads the image first; you wait for it, even when that time is not billed.
- **Try it on your own computer first** with `docker run --rm -it IMAGE sh`, to check that it starts and has what you need.
- **Reuse it for batches.** The same image, passed as `image`, can run [thousands of tasks over the pool](https://rentgpupower.com/guides/run-100000-tasks-with-one-api-call).

## Through the API

Start an instance with your image and start command. It is billed by the second until you stop it or `duration_s` runs out:

```bash
curl https://rentgpupower.com/api/v1/compute/instances \
  -H "Authorization: Bearer $GPURENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image": "pytorch/pytorch:latest", "onstart": "pip install transformers accelerate", "duration_s": 3600}'
```

Or with the [gpurent command line](https://rentgpupower.com/guides/ssh-into-a-rented-gpu):

```bash
gpurent start --image pytorch/pytorch:latest --onstart "pip install transformers accelerate" --duration 3600
gpurent ssh 456
gpurent stop 456
```

`gpurent start` prints the instance's number (456 here), and `gpurent instance 456` — or `GET /instances/456` — shows its state and its cost so far. Stopping early returns the unused time to your credits, and filters such as `--min-vram 24` and `--min-cuda 12.8` (`min_cuda` in the API) choose the card. Your API key and the full reference are on the [developers page](https://rentgpupower.com/developers).

## FAQ

### Can I use a private image?

No. Images must be public, on one of the big registries above. Keep secrets out of the image.

### Is the time spent downloading my image billed?

Not the first time a machine downloads it: up to 15 minutes of that download are not billed. Booking the same image on the same machine again starts from its copy — if that copy was removed meanwhile, the new download counts as rented time.

### Why did my image's app not start by itself?

The rental starts the container with a shell, not with the image's ENTRYPOINT or CMD. Start the app yourself, from the terminal or over SSH — with `nohup … &` if it should keep running after you disconnect.

### Does SSH work with my image?

Yes, if the image has a package manager (apt, apk, dnf or yum) to install the SSH server with, or already contains openssh-server — and the machine has the Docker sandbox.
