Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The reliable pattern is straightforward: run the official ollama/ollama image, mount a named volume at /root/.ollama, bind the API to loopback unless a protected gateway needs it, and add GPU-specific runtime settings only after the VPS driver stack is working. The volume preserves downloaded models when the container is recreated; the network design prevents an unauthenticated inference API from being exposed to the internet.

This guide covers CPU, NVIDIA, AMD and Vulkan deployments, model storage, HTTPS access, proxy downloads, upgrades, backups and the failure modes that matter on a VPS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are deploying

Ollama provides a local model-serving API and command-line client. In a Compose deployment, the Ollama process runs inside a container while Docker supplies networking, restart behavior and storage. Your VPS supplies the CPU or GPU, system memory, disk, kernel devices and internet connection needed to download and run models.

The container API listens on port 11434. That port should normally remain reachable only from the VPS itself, a private network or a reverse proxy. Public clients should reach an authenticated HTTPS endpoint rather than a raw Ollama port.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Container replacement is expected during upgrades, host maintenance and configuration changes. Without persistent storage, downloaded models disappear with the old container. Mounting a named volume at /root/.ollama separates model data from the container lifecycle.

Prerequisites and planning

Software and access

  • A VPS with SSH access and permission to install Docker Engine, the Docker Compose plugin and, for GPU use, the required driver runtime.
  • A firewall or security-group policy that allows SSH and only the web or private-network ports you actually need.
  • Enough persistent disk for every model you plan to keep, plus headroom for downloads, temporary files, logs and upgrades.
  • A decision about access: local-only API, SSH tunnel, private network, VPN or an internet-facing HTTPS gateway.

Choose CPU or GPU before downloading models

CPU-only execution needs no GPU stanza in Compose. NVIDIA requires a compatible host driver and the NVIDIA Container Toolkit. AMD uses the ROCm image and device mappings. Vulkan can use compatible devices exposed by the host, but support depends on the hardware, kernel, driver and Ollama compatibility.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not select a GPU VPS solely from a provider’s advertised GPU name. Recheck Ollama’s current hardware compatibility guidance and the driver’s supported versions before committing to an instance. Backend support, available VRAM and system RAM, persistent-disk performance, expected concurrent users, network egress, region, snapshot capability and total monthly cost all affect the result.

Minimal CPU-only Compose deployment

1. Create the Compose file

Save this as compose.yaml in a dedicated directory on the VPS:

services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    restart: unless-stopped
    ports:
      - '127.0.0.1:11434:11434'
    volumes:
      - ollama:/root/.ollama

volumes:
  ollama:

The image and container path follow Ollama’s Docker example. Binding the host side to 127.0.0.1 is a deliberate security choice for a single VPS: local programs, an SSH tunnel and a reverse proxy on the same host can connect, while unsolicited internet traffic cannot.

2. Validate and start it

  1. Change to the directory containing compose.yaml.
  2. Render and validate the Compose configuration:
docker compose config
  1. Start the service in the background:
docker compose up -d
  1. Follow startup output:
docker compose logs -f ollama
  1. Check the local API version:
curl http://127.0.0.1:11434/api/version

A JSON response from /api/version confirms that the container is answering on the expected port. If the request fails, inspect the logs before downloading a model.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Pull and run a model

Pull a model from inside the running container, then start an interactive session:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
docker compose exec ollama ollama pull llama3.2
docker compose exec ollama ollama run llama3.2

The example model name is only a command example. Choose a model that fits the VPS’s available memory, storage and workload. Universal model-size, speed or quality figures are not established, so measure latency and resource use on the selected host instead of assuming a benchmark from another machine will apply.

Keep models after container recreation

Why the named volume matters

Ollama stores its model data under /root/.ollama in the container. The ollama:/root/.ollama mapping places that directory in a Docker-managed named volume. Recreating or replacing the container leaves the volume intact, so models do not have to be downloaded again.

docker compose down stops and removes the service container but normally keeps named volumes. Adding -v removes the Compose-managed volumes as well:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker compose down -v

Use the volume-removing form only when you intentionally want to erase the model store. A changed image, a restart or a regular docker compose down should not require a full model re-download.

Monitor capacity and protect the data

Model pulls consume persistent disk, not just temporary container space. Check Docker’s usage periodically:

docker system df
docker volume ls
docker volume inspect ollama

The exact volume name can be project-prefixed when Compose creates it; use the name shown by docker volume ls rather than assuming it is literally ollama. Keep free space for new pulls, image layers, logs and upgrades. A full volume can stop downloads and make maintenance fail.

If re-downloading models would be costly in time or bandwidth, snapshot the VPS disk or back up the volume according to your hosting platform’s procedures. Test that a backup can be restored; a snapshot that cannot be attached or mounted is not a recovery plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

NVIDIA GPU with Compose

Prepare the VPS first

Install a supported NVIDIA driver and the NVIDIA Container Toolkit on the host. Configure Docker’s GPU runtime and restart Docker:

sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Validate the host and Docker GPU integration before troubleshooting Ollama. If the host runtime cannot see the GPU, changing the Ollama image or model will not fix the problem.

Use a GPU-enabled service definition

A commonly used Compose shape is:

services:
  ollama:
    image: ollama/ollama
    restart: unless-stopped
    ports:
      - '127.0.0.1:11434:11434'
    volumes:
      - ollama:/root/.ollama
    gpus: all

volumes:
  ollama:

Compose GPU keys differ between releases. Run docker compose config with the installed Compose version and confirm that the generated configuration is accepted. Ollama’s documented Docker invocation uses --gpus=all; the Compose file must express the equivalent GPU access in syntax supported by your installation.

Confirm visibility before pulling a large model

  1. Apply the file with docker compose up -d.
  2. Inspect container logs with docker compose logs ollama.
  3. Check the host’s NVIDIA runtime and GPU monitoring tools while the container is running.
  4. Pull one small, suitable model and observe memory use before adding larger models or concurrent workloads.

GPU support remains hardware- and driver-dependent. A container can start successfully while a particular model or backend still cannot use the available device.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

AMD GPU and Vulkan options

AMD ROCm configuration

For AMD hardware, use Ollama’s ROCm image and expose the kernel devices documented by Ollama:

services:
  ollama:
    image: ollama/ollama:rocm
    restart: unless-stopped
    ports:
      - '127.0.0.1:11434:11434'
    devices:
      - /dev/kfd
      - /dev/dri
    volumes:
      - ollama:/root/.ollama

volumes:
  ollama:

The host still needs a supported AMD driver and ROCm stack. Verify that /dev/kfd and /dev/dri exist, that the container can access them with the required permissions and that the installed ROCm version is supported for the GPU.

Vulkan

Vulkan support is bundled in the standard Ollama image and can use compatible GPU devices exposed by the host. When device selection is necessary, GGML_VK_VISIBLE_DEVICES controls which devices are visible. Set OLLAMA_VULKAN=0 to disable Vulkan.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Vulkan is not a guarantee of acceleration on every VPS. The host must expose compatible devices and a working driver; validate the backend with a small model before planning capacity around it.

Expose Ollama safely over HTTPS

Keep the API private by default

For a local client or a same-host application, keep the Compose mapping on loopback:

ports:
  - '127.0.0.1:11434:11434'

Do not replace the address with 0.0.0.0 merely to make a remote client work. A raw public listener invites unauthorized use, unexpected compute and data exposure.

Use a protected gateway for remote clients

For internet access, place a reverse proxy or API gateway in front of Ollama. The proxy should be the only service publishing ports 80 and 443; Ollama and the proxy can communicate over a private Compose network. Terminate TLS at the gateway, require authentication, and apply an explicit allow-list, VPN or private-network policy where possible.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure streaming-friendly read and idle timeouts. Ollama responses may remain open while a model generates output; a proxy timeout designed only for short web requests can terminate an otherwise healthy stream. Log authentication events and request failures, and restrict who can reach the gateway at the firewall as well as at the application layer.

The official Ollama documentation defines the API and port, not one universal proxy product or authentication scheme. Select a gateway that supports your identity system, streaming behavior, certificate management and logging requirements.

SSH tunneling for administration

If only you need temporary remote access, an SSH tunnel avoids exposing the API publicly. Forward a local port to the VPS’s loopback address, then point your local client at the forwarded port. Remove the tunnel when finished and keep the VPS firewall closed to port 11434.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Pull models through an outbound proxy

Some VPS networks require outbound traffic to pass through a corporate or hosting proxy. Pass HTTPS_PROXY to the Ollama container:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
environment:
  HTTPS_PROXY: https://proxy.example.com

When the proxy intercepts HTTPS, install its trusted certificate in the container’s system trust store using the procedure required by that proxy and base image. Ollama’s FAQ specifically advises against setting HTTP_PROXY; model pulls use HTTPS, and an inappropriate HTTP proxy setting can interrupt client connections.

Operations after the first launch

Restart and upgrade deliberately

restart: unless-stopped brings the service back after a crash or host reboot unless you explicitly stopped it. Before changing the image, check the current API response and review logs:

docker compose logs --tail=200 ollama
curl http://127.0.0.1:11434/api/version

For reproducibility, pin an image digest or maintain a documented, tested image-refresh policy. The floating ollama/ollama tag is convenient, but an unplanned refresh can change runtime behavior. After an upgrade, verify the API, run a small request and check that the existing volume and models are visible.

Control memory residency

OLLAMA_KEEP_ALIVE is a memory-versus-latency tuning control: keeping models resident can reduce reload time but consumes memory. The API’s keep_alive parameter can override the server setting for an individual request. Choose a policy based on the VPS memory budget and whether requests arrive continuously or in bursts.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Measure the selected workload

Before adding models or users, record the behavior that matters to your application:

  • Request latency and completion time for representative prompts.
  • System RAM, GPU memory and CPU utilization while a model is loaded.
  • Disk consumption before and after each model pull.
  • Concurrent-request behavior and whether streams remain stable through the gateway.
  • Network egress, especially when clients are remote or models are frequently refreshed.

There are no universal speed, token-per-second, model-size or monthly-cost figures that apply to every VPS. Measure the exact model, backend, prompt pattern and concurrency you intend to operate.

Choosing a VPS configuration

Decision axis CPU VPS GPU VPS
Backend CPU execution; no GPU stanza required NVIDIA, AMD ROCm or Vulkan, subject to host support
Drivers Standard Docker and kernel requirements Matching vendor driver, toolkit and supported runtime
Memory System RAM is the principal constraint Both system RAM and available VRAM matter
Storage Persistent disk for models and image layers Same requirement; faster I/O can reduce operational delays
Concurrency Validate latency and memory under the intended user count Validate VRAM, scheduling and concurrent streams on the exact GPU
Networking Loopback, private network or protected HTTPS gateway Same network and security requirements
Cost Measure total instance, disk, backup and egress charges Include the GPU premium, storage, snapshots and egress

There is no universally best VPS. A small CPU instance may be appropriate for experimentation or low concurrency; a GPU instance may be justified when measured latency or throughput requirements exceed what the CPU can deliver. Make that decision from measurements and workload requirements, not from the presence of a GPU label alone.

Troubleshooting checklist

The API is unreachable

  • Run docker compose ps and confirm the container is running.
  • Read docker compose logs ollama for startup or permission errors.
  • Confirm the client is using 127.0.0.1:11434 when the port is loopback-bound.
  • If a proxy is involved, verify that it can resolve and reach the Ollama service on the private network.
  • Check the VPS firewall and security group; do not open port 11434 publicly as a diagnostic shortcut.

Models vanished after an update

  • Run docker volume ls and confirm that the expected named volume still exists.
  • Check the service’s volume mapping with docker compose config.
  • Make sure no maintenance command used docker compose down -v.
  • Inspect the mounted path inside the container and verify that the service is using the same Compose project and volume.

NVIDIA is not detected

  • Validate the host driver independently of Ollama.
  • Confirm the NVIDIA Container Toolkit is installed and Docker was configured with nvidia-ctk runtime configure --runtime=docker.
  • Restart Docker after runtime configuration.
  • Check that the installed Compose release accepts the selected GPU key with docker compose config.
  • Only then inspect Ollama logs and model behavior.

AMD or Vulkan acceleration fails

  • For ROCm, confirm the ollama/ollama:rocm image is in use.
  • Verify that /dev/kfd and /dev/dri exist on the host and are accessible to the container.
  • Check driver, kernel and ROCm compatibility for the specific GPU.
  • For Vulkan, confirm that compatible devices are exposed; use GGML_VK_VISIBLE_DEVICES for selection or OLLAMA_VULKAN=0 to disable the backend while diagnosing.

Pulls fail behind a proxy

  • Set HTTPS_PROXY in the container environment.
  • Do not set HTTP_PROXY for this use case.
  • If HTTPS interception is enabled, install the proxy’s certificate in the container trust store.
  • Review container logs for certificate, DNS and connection errors.

The disk fills during normal operation

  • Check Docker and volume usage with docker system df and docker volume inspect.
  • Remove models you no longer need using Ollama’s model-management commands.
  • Increase persistent storage before starting another large pull.
  • Keep monitoring and alerting in place; a full volume can block pulls, upgrades and recovery actions.

A production-readiness checklist

  • The Compose file passes docker compose config.
  • /root/.ollama is mounted to a named, backed-up or snapshotted volume.
  • Port 11434 is loopback-only or restricted to a private network.
  • Remote access uses HTTPS, authentication and an allow-list, VPN or equivalent private boundary.
  • The selected CPU, RAM, VRAM, disk and I/O have been tested with the intended model.
  • GPU drivers and container runtimes have been validated independently where applicable.
  • Restart behavior, log review, API health checks and disk monitoring are documented.
  • Image updates follow a tested release or digest policy.
  • Proxy settings use HTTPS_PROXY and trusted certificates where required.

Bottom line

Use the official Ollama image with a named volume at /root/.ollama, start with a loopback-bound CPU deployment, and add GPU settings only after the VPS runtime is verified. Keep model storage separate from the container, protect port 11434 behind a properly authenticated HTTPS gateway for remote clients, and size the VPS from measured memory, disk, latency and concurrency requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.