DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

How to Run a CS2 Dedicated Server in Docker on a VPS

A complete, practical guide to running a CS2 dedicated server in Docker on a VPS, including the documented resource minimums, Steam token, Docker commands, ports, persistent bind mounts, configuration, updates and troubleshooting.
WorldDocker on a VPS Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The practical way to host a Counter-Strike 2 (CS2) dedicated server on a VPS is to run a maintained Linux container image, provide it with a Steam Game Server Login Token, publish the game’s required ports, and bind-mount its data directory to persistent VPS storage. For the documented joedwards32/cs2 image, plan for at least 2 vCPUs, 2 GiB of RAM, and 60 GB of free disk space; allow extra capacity if you install mods or workshop content.

The container uses SteamCMD to download and update the server files. It updates when it starts, so restarting the container after a CS2 update is the normal maintenance operation. A bind mount at /home/steam/cs2-dedicated/ keeps configuration and downloaded data when you recreate the container.

As an Amazon Associate I earn from qualifying purchases.

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

What you need before starting

A CS2 server is a continuously running process, so a small shared VPS that is adequate for a website may not be adequate for a game server. Select a Linux VPS with a public IPv4 or IPv6 address that players can reach, persistent storage, Docker support, and firewall control.

Resource checklist

Resource Documented minimum How to interpret it
CPU 2 CPUs The minimum stated by joedwards32 in 2026 and repeated by CM2.Network in 2025. Treat this as a floor, not a guarantee for a full server or heavy add-ons.
Memory 2 GiB RAM Reserve headroom for the operating system, Docker, SteamCMD updates, and any additional services on the VPS.
Disk 60 GB free space The image documentation explicitly requires at least 60 GB. Mods and workshop downloads can require more.
Network Publicly reachable address Players must be able to reach the published game ports through both the VPS firewall and any provider-level firewall.

Use persistent disk rather than ephemeral storage. If your provider offers separate disk sizing, allocate more than the documented minimum before installing workshop items or mods. The minimums describe the image’s stated requirements; they do not promise a particular player count, tick behavior, or latency.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

How the Docker setup works

Valve Steam Support states that all Steam game servers use SteamCMD to download and update their server files. The container wraps that process, starts the CS2 server, and exposes configuration through environment variables. Docker supplies process isolation and a repeatable start command, while the VPS supplies CPU, memory, disk, and network connectivity.

The documented image publishes the default game port, 27015, on both TCP and UDP, and publishes 27020 on UDP. Those mappings are container-to-host mappings: the number on the left is the VPS port and the number on the right is the port inside the container. Keep the protocol suffixes; publishing only TCP or only UDP leaves part of the server unreachable.

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

Prepare the VPS

Install and verify Docker

Install Docker Engine and, if you want a declarative configuration, Docker Compose according to your Linux distribution’s current Docker instructions. Verify that the daemon is running and that your administrative account can run Docker. A failed Docker installation is separate from a CS2 failure, so check it before troubleshooting the game server.

Open the network ports

Permit the following traffic in the VPS operating-system firewall and in any provider firewall:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
  • 27015/UDP: the normal game traffic.
  • 27015/TCP: the corresponding published TCP endpoint.
  • 27020/UDP: the additional UDP port published by the basic image example.

Do not assume that a Docker -p option overrides a blocked provider firewall. If players cannot connect, verify both layers and confirm that the VPS address is the one you are giving to players. If you configure a custom RCON port, publish that port over TCP as well and allow it through the same firewall layers.

Create a Steam Game Server Login Token

The image expects a Steam Game Server Login Token in the SRCDS_TOKEN environment variable. Create the token through Steam’s game-server management page. Treat it like a secret: do not commit it to a public repository, paste it into a public issue, or leave it in shell history if your server is administered by more than one person.

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

Keep the token outside a publicly shared Compose file where possible. You can export it in the current shell before launching Docker, use a protected environment file, or enter it through your deployment system’s secret facility. The important operational rule is that the container receives the value as SRCDS_TOKEN and that the token is not exposed in documentation or source control.

Start a basic CS2 container

After Docker is installed, the documented minimal launch command is:

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
SRCDS_TOKEN="..."
docker run -d --name=cs2 
  -e SRCDS_TOKEN="$SRCDS_TOKEN" 
  -p 27015:27015/tcp 
  -p 27015:27015/udp 
  -p 27020:27020/udp 
  joedwards32/cs2

Replace the ellipsis with the token value, or export SRCDS_TOKEN before running the command. The -d flag detaches the process, --name=cs2 gives the container a stable name for later operations, and each -p option publishes one protocol and port.

Check that the process started

  1. Run docker ps and confirm that the container named cs2 is running.
  2. Run docker logs -f cs2 and watch the first startup. SteamCMD may need time to download the server files before the game process is ready.
  3. When you have finished reading the live output, press Ctrl+C. This stops log viewing, not the container.
  4. If the container exits, run docker ps -a and then docker logs cs2 to identify the startup error.

Do not repeatedly create containers with the same name while diagnosing a failure. Remove a failed test container only when you are sure you no longer need its logs, then recreate it with the corrected settings.

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

Make the server data persistent

A container’s writable layer is not a suitable backup strategy. Recreating the container can discard files written inside that layer. Bind-mount a directory on the VPS to /home/steam/cs2-dedicated/, the data path documented by the image.

mkdir -p "$PWD/cs2-data"
sudo chown 1000:1000 "$PWD/cs2-data"
docker run -d --name=cs2 
  -e SRCDS_TOKEN="$SRCDS_TOKEN" 
  -v "$PWD/cs2-data:/home/steam/cs2-dedicated/" 
  -p 27015:27015/tcp 
  -p 27015:27015/udp 
  -p 27020:27020/udp 
  joedwards32/cs2

The ownership command matters because the container runs as the unprivileged steam user, documented as UID 1000. Without matching ownership, the process may be unable to create or update configuration and downloaded files. If you choose another host directory, apply the same ownership requirement to that directory.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Recreate the container without losing data

  1. Stop the running instance with docker stop cs2.
  2. Remove only the container with docker rm cs2; do not delete the cs2-data directory.
  3. Run the same command again, including the bind mount and port mappings.
  4. Confirm with docker logs -f cs2 that the existing files are detected and the server starts.

This procedure preserves the bind-mounted files while replacing the disposable container definition. Back up the host directory separately if the configuration or world state matters; persistence is not the same as backup.

Use Docker Compose for repeatable configuration

The image documentation also provides a Docker Compose example. Compose is useful when you need to keep several environment variables and the volume mapping together, but protect the token and passwords before sharing the file.

services:
  cs2:
    image: joedwards32/cs2
    container_name: cs2
    environment:
      SRCDS_TOKEN: ${SRCDS_TOKEN}
      CS2_SERVERNAME: ${CS2_SERVERNAME}
      CS2_PORT: ${CS2_PORT}
      CS2_MAXPLAYERS: ${CS2_MAXPLAYERS}
      CS2_GAMEALIAS: ${CS2_GAMEALIAS}
      CS2_STARTMAP: ${CS2_STARTMAP}
      CS2_RCONPW: ${CS2_RCONPW}
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/udp"
    volumes:
      - ./cs2-data:/home/steam/cs2-dedicated/

This is an equivalent Compose layout for the documented options; use the image’s current Compose documentation for any additional variables or syntax it introduces. Before starting, create the host directory and set its ownership to UID 1000 as shown earlier. Store the variable values in a protected environment mechanism rather than publishing a token or RCON password in a public repository.

Configure the server with environment variables

The image exposes common server settings as environment variables. The names below are documented by the image and related reference:

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Variable Purpose Operational note
CS2_SERVERNAME Sets the name shown for the server. Use a clear name that helps players identify the correct address.
CS2_PORT Sets the CS2 server port. If you change the port, update Docker’s published mapping and the firewalls consistently.
CS2_MAXPLAYERS Sets the player limit. Choose a limit your VPS resources and intended game mode can support.
CS2_GAMEALIAS Selects the game alias or mode exposed by the image. Use the value documented for the mode you intend to run.
CS2_STARTMAP Chooses the initial map. Confirm that the map is available to the server before selecting it.
CS2_RCONPW Sets the RCON password. Use a unique secret and protect it as carefully as the Steam token.
Workshop variables Configure a workshop collection or related workshop behavior. The image marks workshop support as experimental and downloads can increase disk use.

Change one setting at a time when diagnosing a startup problem. Recreate or restart the container after changing environment variables; editing a host shell variable does not alter an already-running container.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Updating CS2 safely

The container automatically updates the game on startup. When Valve releases a game update, restart the container to trigger that behavior:

docker restart cs2

For a Compose deployment, restart the service using the command appropriate to your Compose installation, then inspect the logs while SteamCMD downloads the new files. Plan the restart when players are not in a match, because the running process is interrupted.

Validate damaged or incomplete files

If a customization, interrupted download, or disk problem leaves damaged files, set STEAMAPPVALIDATE=1 for a validation and redownload pass. With the direct Docker command, add:

-e STEAMAPPVALIDATE=1

Start or recreate the container with that variable, allow SteamCMD to finish, and inspect the logs for completion. Validation can download a substantial amount of data, so verify available disk space first. After the repair pass, remove the variable for normal operation unless you deliberately want validation on every startup.

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.

Common connection and startup failures

The container exits immediately

  • Read docker logs cs2 before changing anything.
  • Confirm that SRCDS_TOKEN is present and was not truncated by shell quoting or a secret-management system.
  • Check that the bind-mounted directory is writable by UID 1000.
  • Check free disk space; the documented image minimum is 60 GB, and workshop content needs additional room.

Players cannot find or join the server

  • Confirm the container is running with docker ps.
  • Verify that 27015 is allowed over both UDP and TCP and that 27020 is allowed over UDP.
  • Check provider-level and operating-system firewalls separately.
  • Confirm that the address and port given to players match the host’s public address and your configured CS2_PORT.
  • If you changed a port, ensure the Docker mapping, environment variable, and firewall rules all use the same value.

Configuration changes do not appear

  • Environment variables are read when the container is created or started; changing a file or shell variable alone does not update an existing container.
  • Recreate the container from the same persistent directory after changing its configuration.
  • Check logs for permission errors caused by an incorrectly owned bind mount.

An update appears stuck

  • Watch docker logs -f cs2 rather than assuming the process is idle.
  • Check disk capacity and network access to Steam’s download services.
  • Do not delete the persistent directory while an update is in progress.
  • If files are damaged, perform the controlled STEAMAPPVALIDATE=1 pass described above.

Security and maintenance practices

  • Use a non-root administrative workflow where practical, and let the container run its documented unprivileged steam user.
  • Keep the Steam token and RCON password out of public Compose files, repositories, screenshots, and shared shell history.
  • Limit firewall exposure to the ports the server actually uses. Do not publish an RCON port publicly unless you need remote administration; if you do, protect it with a strong password and restrictive network rules.
  • Monitor disk usage because updates, logs, maps, mods, and workshop collections accumulate in the persistent directory.
  • Back up the bind-mounted data directory independently of Docker. A persistent mount survives container replacement, but it does not protect against VPS deletion, filesystem corruption, or accidental removal.
  • Verify image tags and digests before production use. Maintenance recency, documented CS2 support, base runtime, persistence path, ownership, token handling, port defaults, configuration coverage, update behavior, validation support, workshop behavior, and image size are sensible criteria when evaluating another image.

A practical first-run checklist

  1. Provision a Linux VPS with at least 2 CPUs, 2 GiB RAM, and 60 GB free persistent disk, plus extra space for any mods.
  2. Install Docker and verify that the daemon runs.
  3. Open 27015/TCP, 27015/UDP, and 27020/UDP in every applicable firewall.
  4. Create a Steam Game Server Login Token and store it as a secret.
  5. Create the host data directory and assign ownership to UID 1000.
  6. Start the container with the token, bind mount, and all three documented port mappings.
  7. Follow the logs until SteamCMD has downloaded the files and the server process is ready.
  8. Set the server name, port, player limit, game alias, start map, RCON password, and optional workshop variables.
  9. Test a connection from outside the VPS network.
  10. Record the restart, validation, backup, and recovery commands for whoever will administer the server.

When this design is the right fit

Docker on a VPS is a good fit when you want a repeatable deployment, a clean separation between the game process and the host, and the ability to replace a container without losing the server directory. It is less suitable if the VPS cannot provide the documented disk minimum, if the provider blocks the required UDP traffic, or if you need a heavily modified installation whose resource requirements exceed the image’s baseline.

The key design decisions are straightforward: meet the resource floor with headroom, publish every required protocol, keep secrets outside shared configuration, and make the data directory persistent. Once those pieces are correct, updates are handled by restarting the container and recovery is handled by validating files without deleting the mounted data.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.