Ollama can run language models on a Linux VPS and expose a local HTTP API for your applications. The reliable setup is straightforward: install Ollama, run it as a dedicated systemd service, place models on a disk with enough capacity, and keep the API private unless you add deliberate access controls. This guide covers installation, model lifecycle commands, storage relocation, GPU and memory planning, updates, and safe remote access.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What you need before installing Ollama
Use a Linux VPS on an architecture supported by the Ollama release you install. Confirm whether the machine is amd64 or arm64 before downloading a manual archive. A practical deployment also needs:
As an Amazon Associate I earn from qualifying purchases.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute- A distribution that can run systemd, or an equivalent supervisor if your provider does not use systemd.
- Persistent storage for model files. Model downloads are commonly several gigabytes each, and multiple models can quickly outgrow a small root disk.
- Enough system RAM, and optionally compatible GPU memory, for the model, its context window, and concurrent requests.
- Private networking, a firewall, or an authenticated reverse proxy if another machine must call the API.
There is no universal “right” VPS size. Compare GPU type and VRAM, CPU and system RAM, persistent disk capacity and I/O, CPU architecture, network egress, private-network controls, systemd support, and regional price and availability.
Install Ollama on a Linux VPS
Use the official installer
For a standard Linux installation, run the installer as a privileged user:
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
curl -fsSL https://ollama.com/install.sh | sh
The installer places the Ollama executable in the normal system location. The official Linux installation also documents optional NVIDIA CUDA and AMD ROCm packages when you want GPU acceleration. Install the package that matches your GPU and driver stack; CPU inference remains an option when no supported GPU is available.
Install from an architecture-specific archive
If your distribution policy does not allow a shell-piped installer, download the archive for the VPS architecture, extract it into the documented system location, and ensure the executable is available as /usr/bin/ollama. Do not install an amd64 archive on an ARM64 host or vice versa. Verify the binary after extraction:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →ollama --version
Keep the installer or archive method consistent with your update process. Re-running the Linux installer updates an installation; you can also download a newer archive. To pin a particular release during installation, set a version in the installer environment, for example:
OLLAMA_VERSION=0.5.7 curl -fsSL https://ollama.com/install.sh | sh
Only use a pinned version when you have a compatibility or change-management reason; otherwise, plan an update window and test your models and clients after upgrading.
Run Ollama continuously with systemd
A foreground ollama serve process ends when your SSH session or shell ends. A systemd unit starts it at boot, restarts it after a failure, and gives you standard status and log commands.
Create a service account
Create a dedicated user and group rather than running the daemon as root:
sudo useradd --system --create-home --shell /usr/sbin/nologin ollama
If your distribution does not create the group automatically, create it first and use the group explicitly:
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo groupadd --system ollama
sudo useradd --system --gid ollama --create-home --shell /usr/sbin/nologin ollama
Use whichever command matches your distribution’s existing accounts; do not create a duplicate user or group.
Create the unit file
Create /etc/systemd/system/ollama.service with a service that runs the server as that account:
[Unit]
Description=Ollama service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=ollama
Group=ollama
ExecStart=/usr/bin/ollama serve
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
The important deployment properties are the dedicated User and Group, the ollama serve command, and boot-time enablement. If your package installed a unit already, inspect it with systemctl cat ollama before creating a second definition.
Enable, start, and verify the service
- Reload unit files:
sudo systemctl daemon-reload. - Enable startup at boot:
sudo systemctl enable ollama. - Start the service now:
sudo systemctl start ollama. - Check the result:
sudo systemctl status ollama.
A healthy service remains active after you disconnect from SSH and returns after a reboot. If it fails, inspect the journal before changing settings:
journalctl -e -u ollama
Download, run, inspect, unload, and delete models
Ollama separates the server process from model management. The following commands operate on model names available to your installation.
| Task | Command | What it does |
|---|---|---|
| Download a model | ollama pull <model> |
Downloads model data to the configured model directory. |
| Run interactively | ollama run <model> |
Loads the model and opens an interactive prompt. |
| List installed models | ollama list |
Shows models already downloaded on the VPS. |
| Inspect model metadata | ollama show <model> |
Displays details such as the model definition and parameters. |
| See loaded models | ollama ps |
Shows models currently resident in CPU memory or GPU memory. |
| Unload a model | ollama stop <model> |
Removes the running model from memory without deleting its files. |
| Delete a model | ollama rm <model> |
Removes the downloaded model data. |
Use ollama stop when you need to free memory temporarily. Use ollama rm only when you no longer need the model or need to reclaim disk space; downloading it again will consume bandwidth and storage.
Choose model and memory capacity realistically
Model files, context, and concurrency all consume memory. The quickstart’s gemma4:e2b example is about 7.2 GB and recommends 8 GB of available VRAM or unified memory for that example. A larger context window requires additional memory, so that recommendation is not a universal requirement for every model or workload.
Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
CPU, GPU, and split loading
GPU acceleration is optional. With a supported NVIDIA CUDA or AMD ROCm setup, Ollama can place model data on a GPU. If a model does not fit entirely on one GPU, Ollama may spread it across available GPUs; when it fits on one GPU, the FAQ says it will load it there. A CPU-only VPS can still run models, but response speed and practical model size depend on its processors and RAM.
Run ollama ps while a model is loaded. Its placement indicator can show 100% GPU, 100% CPU, or a split such as 48%/52% CPU/GPU. Treat that output as an operational check rather than assuming a model is using the GPU because drivers are installed.
Context length and parallel requests
The default context length is 4,096 tokens. Set a different default with OLLAMA_CONTEXT_LENGTH, or set num_ctx on an individual request. More context increases memory use.
Ollama’s documented defaults are:
| Setting | Default | Effect |
|---|---|---|
OLLAMA_MAX_LOADED_MODELS |
Three times the number of GPUs, or three for CPU inference | Limits how many models can remain loaded. |
OLLAMA_NUM_PARALLEL |
1 | Controls parallel requests handled by a model. |
OLLAMA_MAX_QUEUE |
512 | Limits requests waiting for processing. |
Parallel processing increases memory use in proportion to context length. Start with the defaults, observe memory and queue behavior, and increase concurrency only when the VPS has headroom.
Free tools Windows power users keep installed
One-click scans. No signup required.
Move models to a larger disk
On Linux, the default model directory is /usr/share/ollama/.ollama/models. A small root volume can fill even when the operating system itself is healthy. Attach and mount a larger persistent disk first, then move the model directory and point the service to it.
Prepare the destination
- Mount the new volume at a stable path, such as
/srv/ollama, using your provider’s persistent-disk instructions. - Create a models directory:
sudo mkdir -p /srv/ollama/models. - Stop Ollama before copying files:
sudo systemctl stop ollama. - Copy the existing directory, preserving ownership and permissions. For example:
sudo rsync -aHAX /usr/share/ollama/.ollama/models/ /srv/ollama/models/. - Assign ownership to the service account:
sudo chown -R ollama:ollama /srv/ollama.
If the original directory is empty, skip the copy and create the destination with the same ownership. Keep the old files until the new location has been tested and verified.
Set OLLAMA_MODELS in a systemd drop-in
Use the documented systemd override workflow:
- Open the drop-in editor:
sudo systemctl edit ollama.service. - Add an environment line beneath
[Service]:
[Service]
Environment="OLLAMA_MODELS=/srv/ollama/models"
- Save the file, then reload systemd:
sudo systemctl daemon-reload. - Restart Ollama:
sudo systemctl restart ollama. - Verify with
ollama listand, if necessary,journalctl -e -u ollama.
The ollama user must have read and write access to the destination. If models disappear after the restart, check the effective environment, mount status, path spelling, and directory ownership before downloading them again.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Configure Ollama with environment variables
Set service-wide options in the same systemd drop-in. Keep all environment lines under one [Service] section:
[Service]
Environment="OLLAMA_MODELS=/srv/ollama/models"
Environment="OLLAMA_HOST=127.0.0.1:11434"
Environment="OLLAMA_CONTEXT_LENGTH=4096"
Environment="OLLAMA_KEEP_ALIVE=5m"
Environment="OLLAMA_MAX_LOADED_MODELS=3"
Environment="OLLAMA_NUM_PARALLEL=1"
Environment="OLLAMA_MAX_QUEUE=512"
The values above illustrate the documented defaults for context, loaded models, parallel requests, and queue size; choose values that match your hardware. OLLAMA_KEEP_ALIVE controls how long a model remains resident after a request. A longer value reduces reloads but retains memory; a shorter value releases memory sooner.
After every environment change, run:
sudo systemctl daemon-reload
sudo systemctl restart ollama
Do not raise model count, context, or parallelism simultaneously. Change one variable, watch ollama ps and the service journal, and confirm that latency, memory use, and queueing remain acceptable.
Use the local API
When the service is running on the VPS, test it locally through the documented API endpoint:
curl http://localhost:11434/api/chat
-H 'Content-Type: application/json'
-d '{"model":"<model>","messages":[{"role":"user","content":"Reply with one short sentence."}]}'
Replace <model> with a name shown by ollama list. Local requests do not require an API key. A failed local request usually points to a stopped service, a wrong model name, insufficient memory, or a malformed JSON request. Check systemctl status ollama and journalctl -e -u ollama before troubleshooting the client.
Expose the API safely for remote clients
Ollama binds to 127.0.0.1 on port 11434 by default. This keeps the API local to the VPS. Change OLLAMA_HOST only when remote access is intentional.
Prefer a private path
The safest remote designs keep Ollama bound locally and place your application on the same host, in a private network, or behind a tunnel that does not publish the service to the public internet. Restrict source addresses with a firewall or provider security group.
Best Value
Use an authenticated reverse proxy when publication is required
If a client must connect over the internet, put an authenticated, restricted reverse proxy in front of Ollama. Terminate TLS there, require credentials or an identity-aware access policy, limit allowed methods and source networks, and apply rate limits appropriate to your workload. The Ollama FAQ documents reverse-proxy and tunnel approaches, but the proxy’s authentication and firewall policy remain your responsibility.
Recommended Free Tools
Do not assume that a remote request is protected because local requests need no API key. A publicly reachable unauthenticated endpoint lets anyone who can connect consume CPU, GPU, memory, disk, and network resources.
Updating and operating the VPS
Update Ollama
Rerun the Linux installer to update an installed binary, or replace it with a newer architecture-specific archive. If you pinned a release with OLLAMA_VERSION, deliberately select the next version rather than allowing an accidental change. After updating, restart the service and run a small API request.
Monitor before increasing load
- Use
ollama psto confirm where each loaded model resides and whether it is consuming CPU, GPU, or both. - Use
ollama listto check that expected models remain installed after storage changes. - Use
journalctl -e -u ollamafor startup failures, model-load errors, and queue or memory messages. - Watch VPS-level RAM, swap, GPU VRAM, disk space, and disk latency with your normal operating-system or provider monitoring.
Common failures and recovery steps
The service is inactive after reboot
Run sudo systemctl status ollama. If it is disabled, run sudo systemctl enable ollama. If it is failing, read journalctl -e -u ollama; common causes include a bad executable path, an invalid environment line, or a volume that was not mounted before startup.
Models cannot be downloaded or found
Confirm that the model directory exists and is writable by ollama. For a custom path, check OLLAMA_MODELS in the systemd drop-in, run sudo systemctl daemon-reload, restart the service, and then run ollama list. A missing mount can make a healthy empty directory appear to contain no models.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsThe model does not fit
Stop unused models with ollama stop <model>, reduce context length, or choose a smaller model. If the VPS has multiple GPUs, Ollama may distribute a model that does not fit on one GPU. If RAM or VRAM remains insufficient, resizing the VPS or moving to a GPU instance is the durable solution.
Requests queue or become unstable
Keep OLLAMA_NUM_PARALLEL at its default of one while diagnosing. Check context length, loaded-model count, queue depth, and memory pressure. Increase concurrency only after observing stable memory and latency; parallel processing consumes more memory as context length grows.
Remote clients cannot connect
First test curl locally on the VPS. If local access works, inspect OLLAMA_HOST, the reverse-proxy upstream, firewall rules, provider security groups, TLS configuration, and authentication policy. If local access fails, fix the Ollama service before changing network exposure.
Quick Recap
A deployment checklist
- Install the binary that matches the VPS architecture.
- Create or verify the dedicated
ollamauser and group. - Run
/usr/bin/ollama serveunder systemd and enable it at boot. - Pull one model, run it, and verify with
ollama list,ollama ps, and a local API call. - Move
OLLAMA_MODELSto persistent larger storage before the root disk fills. - Set context, keep-alive, loaded-model, parallel-request, and queue limits conservatively.
- Keep the default loopback bind unless remote access is required.
- For remote access, use a private network or an authenticated, restricted TLS proxy.
- Monitor memory, VRAM, disk, service logs, and queue behavior before scaling concurrency.
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.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →




