Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon 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 NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk9 min

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

Host a CS2 dedicated server in Docker with the right VPS resources, Steam login token, port mappings and persistent bind mount. This guide covers configuration, Compose, updates, validation and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can run a Counter-Strike 2 dedicated server on a Linux VPS with Docker, provided the VPS has at least 2 vCPUs, 2 GiB of RAM, 60 GB of persistent disk, a public IP address, and firewall rules for the server ports. The maintained joedwards32/cs2 image downloads and updates the game with SteamCMD, exposes the standard game and TV ports, and reads server settings from environment variables.

The important operational detail is persistence: bind-mount /home/steam/cs2-dedicated/ to storage on the VPS and make that directory writable by the container’s unprivileged Steam user. You can then recreate or update the container without losing configuration and downloaded files.

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 container is still a full game server. Docker isolates the process, but it does not remove the CPU, memory, disk, network, or Steam authentication requirements.

VPS checklist

  • Operating system: a supported Linux distribution with Docker Engine installed and the Docker daemon enabled.
  • CPU: at least 2 vCPUs.
  • Memory: at least 2 GiB RAM. Leave headroom for the operating system, Docker, monitoring, and any additional server processes.
  • Storage: at least 60 GB of free, persistent disk. Mods and workshop content can require more space.
  • Network: a public IPv4 address (and IPv6 if you intend to offer it), plus provider and host-firewall rules that permit the required TCP and UDP traffic.
  • Privileges: an account that can run Docker, usually through the docker group or sudo.

The 2-CPU, 2-GiB, 60-GB figures are the minimums stated by joedwards32 (2026) and repeated by CM2.Network (2025); they are not a performance guarantee for a busy server or a heavily modded installation.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [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.

Install Docker first

Install Docker Engine and, if you want a declarative configuration, Docker Compose using your Linux distribution’s current official instructions. Verify that the daemon responds before continuing:

docker version
docker compose version

If either command fails, fix Docker permissions or the daemon state before troubleshooting CS2. A container cannot start reliably while the Docker installation itself is incomplete.

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

Understand the ports and network path

The image’s basic example publishes one port over both protocols and a separate UDP port:

Port Protocol Typical role What to allow
27015 UDP CS2 game traffic and discovery Allow inbound UDP at the VPS provider firewall and the Linux host firewall.
27015 TCP TCP services associated with the server’s default port Publish and allow inbound TCP as shown in the image example.
27020 UDP SourceTV or related server traffic in the image’s default mapping Allow inbound UDP when you use the service that needs it.

Publishing a port with Docker only creates the container-to-host mapping. It does not override a cloud security group, provider firewall, ufw, nftables, or another packet filter. Open the same protocol and port in every firewall layer that applies. If you change the game port with CS2_PORT, change the Docker mapping and firewall rules to match. A custom RCON port must be published over TCP as well.

Get a Steam Game Server Login Token

Valve’s Steam Support explains that Steam game servers use SteamCMD to download and update their server files. The container therefore needs a Steam Game Server Login Token (GSLT), supplied through the SRCDS_TOKEN environment variable.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【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.
  1. Open Steam’s game-server management page while signed in to the account that will own the token.
  2. Create a token for the appropriate game application and copy it once it is shown.
  3. Store it in a password manager or a root-readable secret file. Do not commit it to a public repository, paste it into a public issue, or leave it in shell history.

The token is an authentication credential, not the server’s player password. You will configure the latter separately with CS2_RCONPW or the relevant game settings.

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.

Start a basic CS2 container

Once Docker is working and the token is available in your shell, the documented minimal launch command is:

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 real token; do not publish that value in an article, script repository, or shared terminal transcript. Docker downloads the image if necessary, creates the container, and runs its startup process in the background.

Check startup instead of guessing

Immediately inspect the container and its logs:

docker ps --filter name=cs2
docker logs -f cs2

Wait for SteamCMD and the game files to finish downloading. A container that is still downloading is not yet ready for players. Press Ctrl+C to stop following logs; it does not stop the container.

Make the server survive recreation

Without a mount, the game files and generated configuration live in the container’s writable layer. Removing that container removes the data. Create a host directory and assign it to UID 1000, the image’s unprivileged steam user:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [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
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 step matters. The process inside the image does not run as root, so a root-owned bind mount can produce write failures during downloads, updates, map changes, or log creation. If you already started an unmounted container, stop and remove it only after deciding whether any files in it need to be copied out; then launch the replacement with the bind mount.

Back up the mount

Treat cs2-data as the server’s state directory. Stop the container before making a consistent archive, copy the directory to storage outside the VPS, and restrict the backup permissions because it can contain credentials and administration settings. A persistent mount protects against container recreation; it does not protect against disk failure, accidental deletion, or a compromised host.

Configure the server with environment variables

The image exposes common settings as environment variables. Add them to the docker run command or a Compose file before the image name.

Variable Purpose Operational note
CS2_SERVERNAME Public server name Use a descriptive name that tells players the region, mode, or rules.
CS2_PORT Game server port If changed, update Docker’s published port and every firewall rule.
CS2_MAXPLAYERS Maximum player count Choose a value your CPU and network can sustain rather than simply using the largest value.
CS2_GAMEALIAS Game mode or alias selection Use the alias supported by the image and current CS2 server files.
CS2_STARTMAP Initial map Verify the map name and its availability in the installed files.
CS2_RCONPW Remote-console password Use a long, unique secret and never reuse the Steam token.
Workshop variables Workshop collection or related content The image marks workshop support as experimental; test changes on a non-public instance first.

A representative launch with settings looks like this:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker run -d --name=cs2 
  -e SRCDS_TOKEN="$SRCDS_TOKEN" 
  -e CS2_SERVERNAME="My CS2 VPS" 
  -e CS2_MAXPLAYERS="10" 
  -e CS2_GAMEALIAS="competitive" 
  -e CS2_STARTMAP="de_dust2" 
  -e CS2_RCONPW="$CS2_RCONPW" 
  -v "$PWD/cs2-data:/home/steam/cs2-dedicated/" 
  -p 27015:27015/tcp 
  -p 27015:27015/udp 
  -p 27020:27020/udp 
  joedwards32/cs2

Use values appropriate to the current CS2 release and the image documentation. Environment variables are read at container creation; changing a shell variable later does not alter an already-created container. Recreate the container with the revised options, keeping the same data mount.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • 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.

Use Docker Compose for repeatable operation

Compose is useful when the command has several environment variables and port mappings. Save a file such as compose.yaml in a directory that is not publicly served:

services:
  cs2:
    image: joedwards32/cs2
    container_name: cs2
    restart: unless-stopped
    environment:
      SRCDS_TOKEN: ${SRCDS_TOKEN}
      CS2_SERVERNAME: ${CS2_SERVERNAME}
      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/

Create a local environment file with restrictive permissions, set the values, and start the service:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chmod 600 .env
docker compose up -d
docker compose logs -f cs2

Do not commit .env or include it in a public backup. Compose’s restart: unless-stopped helps recover from a process exit, but it does not replace monitoring or backups.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How updates work

The image automatically updates the game on startup. When Valve releases a CS2 server update, restart the container so its startup process runs SteamCMD again:

docker restart cs2

With Compose, use docker compose restart cs2. Follow the logs until the update completes, then confirm the process is listening and the server appears to players. A restart is safer than deleting the persistent directory: the mount retains configuration and downloaded content while the image refreshes the installation.

Validate damaged files

If a failed download, modification, or disk problem leaves the installation inconsistent, set STEAMAPPVALIDATE=1 for a validation and redownload pass. For a one-time Docker run, add:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
-e STEAMAPPVALIDATE=1

For Compose, add STEAMAPPVALIDATE: "1" under environment, recreate or restart the service as required by the image’s startup behavior, and watch the logs. Validation can take substantial time and disk bandwidth because SteamCMD may redownload damaged files. Remove the setting after the repair if you do not want validation on every subsequent startup.

Common failures and fixes

The container exits immediately

  • Run docker logs cs2 and look for a missing or invalid SRCDS_TOKEN.
  • Confirm the image name and tag are available locally or can be pulled.
  • Check that the mounted directory exists and is owned by UID 1000.
  • Verify that the VPS has at least the documented disk minimum and that the filesystem is not full.

Players cannot connect

  • Confirm the container is running with docker ps.
  • Check that both UDP and TCP 27015 are published, and UDP 27020 is published when required.
  • Open the same ports in the provider firewall and the operating-system firewall.
  • Use the VPS’s public address, not a private Docker or RFC 1918 address.
  • If you changed CS2_PORT, ensure the external mapping and advertised port use the same value.

Updates fail or files are missing

  • Inspect logs for SteamCMD errors and check free disk space.
  • Confirm the bind mount is writable by UID 1000.
  • Restart once to rerun the image’s startup update.
  • Use STEAMAPPVALIDATE=1 for a validation/redownload pass.

Settings revert after a rebuild

The replacement container was probably created without the original volume or with a different host path. Inspect the mount with docker inspect cs2, then recreate the container using the same cs2-data directory and the complete environment-variable set.

Security and maintenance practices

  • Keep the Steam token, RCON password, and any administrative credentials out of public Compose files and shell history where possible.
  • Expose only the ports you use. Do not publish an RCON port to the internet unless remote administration genuinely requires it; if you do, restrict source addresses at the firewall.
  • Run the image as documented and preserve its unprivileged steam ownership model rather than making the data directory world-writable.
  • Monitor disk usage because workshop content and logs can consume the 60-GB minimum quickly.
  • Back up the persistent directory before major configuration changes and before experimenting with workshop content.
  • Verify image tags and digests before production use. Maintenance recency, documented CS2 support, base runtime, persistence path, token handling, default ports, configuration surface, update behavior, validation support, workshop status, and image size are the useful criteria when evaluating another image.

Choosing an image and sizing for growth

The documented joedwards32 image is the implementation used in the commands above. CM2.Network also documents a CS2 image and repeats the same minimum of 2 CPUs, 2 GiB RAM, and 60 GB disk. The available references do not establish identical maintenance schedules, image sizes, tags, or feature behavior for the two projects, so verify current tags and digests and read the image’s own documentation before switching.

Start with the stated minimum only for a lightly used, closely monitored server. Increase CPU, memory, and disk when you add workshop collections, multiple instances, higher player limits, telemetry, backups, or other services on the VPS. The correct size depends on the workload; the published minimum is a floor, not a promise of a particular tick rate or player capacity.

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.

Operational checklist

  1. Provision a Linux VPS with 2 vCPUs, 2 GiB RAM, 60 GB persistent disk, and room for mods.
  2. Install and verify Docker Engine and Compose if desired.
  3. Create a Steam Game Server Login Token and protect it.
  4. Create cs2-data and run sudo chown 1000:1000 on it.
  5. Launch the container with SRCDS_TOKEN, the persistent volume, and TCP/UDP port mappings.
  6. Open the same ports in every applicable firewall.
  7. Set the server name, player limit, game alias, start map, RCON password, and optional workshop variables.
  8. Watch logs through the initial SteamCMD download and test a real client connection.
  9. Back up the mounted directory and record the exact image tag and environment values.
  10. Restart after CS2 updates; use STEAMAPPVALIDATE=1 when files need repair.

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 from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
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.