{"id":1662,"date":"2026-11-12T04:12:08","date_gmt":"2026-11-12T04:12:08","guid":{"rendered":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/?p=1662"},"modified":"2026-11-12T04:12:08","modified_gmt":"2026-11-12T04:12:08","slug":"tmux-screen-persistent-steam-consoles","status":"publish","type":"post","link":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/","title":{"rendered":"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window"},"content":{"rendered":"<p><strong>TL;DR:<\/strong> A game server that only exists inside an SSH session dies with the session. Run SteamCMD and the game binary inside tmux or screen so the console survives disconnects, wrap it in a systemd unit for restart and boot behaviour, and keep the two roles separate: systemd owns the process, tmux owns the console. Mixing them is how you end up with two instances fighting over a lock file.<\/p>\n\n<h2>What actually happens when you close the terminal<\/h2>\n<p>SSH allocates a pseudo-terminal and delivers it to your shell. Every process started from that shell inherits the pty and a controlling terminal. When the session ends, the kernel sends SIGHUP to the foreground process group, and most game servers treat SIGHUP as &#8220;exit&#8221; \u2014 sometimes without saving. Even a server that ignores SIGHUP keeps its stdout attached to a pty that no longer exists and starts blocking when the buffer fills.<\/p>\n<p>Three ways out, in increasing order of robustness:<\/p>\n<ol>\n<li><strong><code>nohup binary &amp;&gt; log &amp;<\/code><\/strong> \u2014 survives the disconnect, but you lose the console. Fine for a daemon, poor for a game server where the console is a management interface.<\/li>\n<li><strong>tmux or screen<\/strong> \u2014 the console survives and is reattachable from anywhere.<\/li>\n<li><strong>systemd<\/strong> \u2014 restart policy, resource limits, boot ordering and journal output, with tmux for interactive console access.<\/li>\n<\/ol>\n<p>Use 2 and 3 together. The <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/steamcmd-systemd-multiple-game-server-instances-dedicated\/\">SteamCMD and systemd multi-instance guide<\/a> covers the unit-file side for several servers on one machine; this article is about the console layer that sits beside it.<\/p>\n\n<h2>tmux or screen \u2014 pick one and standardise<\/h2>\n<p>Both solve the problem. The differences that matter on a game node:<\/p>\n<ul>\n<li><strong>tmux<\/strong> has cleaner scripting, vertical splits, a richer status bar and a better default for teams. Configuration lives in <code>\/etc\/tmux.conf<\/code> for a system-wide setup.<\/li>\n<li><strong>screen<\/strong> is installed everywhere, has simpler attach semantics and is what many older game guides assume. Its <code>screen -L<\/code> logging is genuinely useful.<\/li>\n<li><strong>Both<\/strong> buffer output in memory. A console that nobody reads for three days grows, and a server generating thousands of lines per minute during a wipe will consume tens of megabytes per session.<\/li>\n<\/ul>\n<p>Whichever you choose, pin it. Half the node&#8217;s instances in tmux and half in screen is a runbook nightmare when the nightly Discord message says &#8220;server down&#8221; and nobody remembers which socket to attach to.<\/p>\n\n<h2>tmux basics for a game operator<\/h2>\n<pre><code># start a named session detached, run the game inside it\ntmux new-session -d -s srv-rust1 \\\n  '\/opt\/rust\/RustDedicated -batchmode +server.port 28015 +server.level Procedural'\n\n# reattach from any SSH client\ntmux attach -t srv-rust1\n\n# list sessions, then detach without killing anything\ntmux ls\n# Ctrl-b then d<\/code><\/pre>\n<p>Two settings worth setting on a shared box immediately:<\/p>\n<pre><code># \/etc\/tmux.conf\nset-option -g history-limit 50000\nset-option -g destroy-unattached off<\/code><\/pre>\n<p><code>history-limit<\/code> sets how far back you can scroll a console. The default 2000 lines disappears the moment a save cycle logs its chunk write progress. <code>destroy-unattached off<\/code> prevents a session from dying if you ever start one without <code>-d<\/code> and lose the terminal.<\/p>\n\n<h2>screen basics, and why people still use it<\/h2>\n<pre><code>screen -S srv-pal -L -Logfile \/var\/log\/pal-srv.log \\\n  \/opt\/palserver\/PalServer.sh -port=8211\n\nscreen -r srv-pal        # reattach\n# Ctrl-a then d          # detach\nscreen -ls               # list<\/code><\/pre>\n<p><code>-L<\/code> with <code>-Logfile<\/code> gives you console logging without a second tool, and often replaces the game&#8217;s own log file entirely. That is the strongest argument for screen on hosts that just want &#8220;console plus log, no extra moving parts&#8221;.<\/p>\n\n<h2>Send commands without attaching<\/h2>\n<p>The real value of a named console is automation: restart warnings, saves, whitelist reloads, without a human in a session.<\/p>\n<pre><code># tmux: send a command and a newline into a session\ntmux send-keys -t srv-rust1 'server.save' Enter\n\n# screen: paste a command into the running session\nscreen -S srv-pal -p 0 -X stuff 'save\\n'<\/code><\/pre>\n<p>Wrap these in small scripts and call them from cron or a systemd timer: a 5-minute warning broadcast at <code>T-300<\/code>, a save at <code>T-60<\/code>, the restart itself. This is the mechanism behind the <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/how-to-automate-game-server-backups-scheduling-restarts-and-world-saves-without-player-downtime\/\">automated backup and restart scheduling<\/a> pattern, and it is far safer than a restart script that sends SIGKILL.<\/p>\n<p>Note the trailing <code>Enter<\/code> for tmux and <code>\\n<\/code> for screen. Getting that wrong produces a command sitting in the input buffer that fires with the <em>next<\/em> thing you type, which is a genuinely confusing failure mode.<\/p>\n\n<h2>Do not let tmux own the process lifetime<\/h2>\n<p>The temptation is to treat the tmux session as the supervisor: if the game crashes, restart it by sending a command. That works until the session is killed, the machine reboots, or someone types <code>exit<\/code> in the wrong pane. Then nothing restarts, and the node sits idle until a player complains.<\/p>\n<p>The division that survives contact with reality:<\/p>\n<ul>\n<li><strong>systemd<\/strong> owns start, stop, restart-on-failure, boot ordering, resource limits and log capture.<\/li>\n<li><strong>tmux<\/strong> provides a console to the process systemd started, for interactive commands and for reading output.<\/li>\n<\/ul>\n<p>If you want both, run a unit that starts the game inside a named tmux session with <code>Type=forking<\/code> or a wrapper script, and let <code>Restart=on-failure<\/code> handle crashes. The unit is still the supervisor; tmux is just the window.<\/p>\n\n<h2>The two-instances-one-lockfile failure<\/h2>\n<p>The most common self-inflicted outage on a game node: someone starts the server manually in a tmux session while systemd is also managing it. The second process fails on a port bind or a world lock, the first keeps running untracked, and the next <code>systemctl restart<\/code> stops the <em>tracked<\/em> process \u2014 which was never serving players \u2014 while the untracked one keeps the old world open.<\/p>\n<p>Guard against it:<\/p>\n<ul>\n<li>Before any manual start, run <code>systemctl status<\/code> and <code>ss -lunp | grep &lt;port&gt;<\/code>. Confirm nothing is listening.<\/li>\n<li>Make manual starts an explicit, documented procedure with a matching manual stop, never an improvised <code>.\/start.sh<\/code>.<\/li>\n<li>Have the console send <code>save<\/code> and <code>stop<\/code> rather than killing the session, so the world closes cleanly.<\/li>\n<\/ul>\n<p>The same discipline protects against save corruption, which is covered in <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/game-server-save-corruption-atomic-writes-retention\/\">save corruption and atomic writes<\/a>.<\/p>\n\n<h2>Console buffers, memory and the OOM killer<\/h2>\n<p>A tmux session with a 50,000-line history per pane is not free. On a node running six instances, each with a chatty console, history buffers can add a few hundred megabytes \u2014 and they are invisible to the game&#8217;s own memory accounting. When the OOM killer picks a victim, it does not care that the memory belonged to a scrollback buffer.<\/p>\n<p>Practical limits:<\/p>\n<ul>\n<li>Keep <code>history-limit<\/code> at 10,000\u201350,000, not a million.<\/li>\n<li>Enable the game&#8217;s own log file with rotation and let the console hold only recent output.<\/li>\n<li>If a console is genuinely high-volume, redirect to a file with <code>logrotate<\/code> and keep the interactive session quiet.<\/li>\n<\/ul>\n<p>Check real consumption with <code>ps -o rss,cmd -C tmux<\/code> and compare it against your <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/game-server-ram-disk-usage-metrics-capacity-planning\/\">RAM and disk metrics<\/a> after a week, not after an incident.<\/p>\n\n<h2>Make consoles survive reboots, and survive you<\/h2>\n<p>The final piece is the runbook. Write down, in one file on the node and one in your notes:<\/p>\n<ol>\n<li>Session naming convention, e.g. <code>srv-&lt;game&gt;-&lt;slot&gt;<\/code>.<\/li>\n<li>The unit name and the console attachment command for each game.<\/li>\n<li>The save-then-stop sequence, and the warning schedule players expect.<\/li>\n<li>What to check first when a session exists but the port is not listening.<\/li>\n<\/ol>\n<p>Then test it from a fresh SSH client with no history: attach to every session, confirm the game responds to a console command, confirm <code>systemctl status<\/code> agrees. A console you cannot reach at 2 a.m. is the same as no console.<\/p>\n<p>The console layer is a small piece of operational maturity, but it is the piece that turns &#8220;someone&#8217;s SSH window&#8221; into infrastructure. If you are still choosing the machine underneath, our <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/multi-game-server-hosting-running-several-game-servers-on-one-dedicated-machine\/\">multi-game server hosting guide<\/a> covers how many instances a node should carry, and <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/pterodactyl-pelican-panel-scaling-dedicated-game-hosting\/\">panel scaling with Pterodactyl and Pelican<\/a> is the natural next step once consoles and units are under control.<\/p>\n\n\n<p class=\"wp-block-paragraph\">Running consoles under tmux is the low-effort version of process supervision; systemd units are the version that survives a reboot. Whichever you pick, the machine underneath decides how many instances you can hold \u2014 the <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/#plans\">dedicated plans table<\/a> lists core counts and RAM per tier, and the <a href=\"https:\/\/bestdedicatedwebhostingserver.com\/\">main site<\/a> explains which configs suit multi-instance hosting.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>TL;DR: A game server that only exists inside an SSH session dies with the session. Run SteamCMD and the game binary inside tmux or screen so the console survives disconnects,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1662","post","type-post","status-publish","format-standard","hentry","category-server-guides-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window - Best Dedicated Web Hosting Server Blog<\/title>\n<meta name=\"description\" content=\"TL;DR: A game server that only exists inside an SSH session dies with the session. Run SteamCMD and the game binary inside tmux or screen so the console\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window\" \/>\n<meta property=\"og:description\" content=\"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/\" \/>\n<meta property=\"og:site_name\" content=\"Best Dedicated Web Hosting Server Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-12T04:12:08+00:00\" \/>\n<meta name=\"author\" content=\"bestdedicatedwebhostingserver\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bestdedicatedwebhostingserver\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"bestdedicatedwebhostingserver\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/\",\"url\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/\",\"name\":\"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window - Best Dedicated Web Hosting Server Blog\",\"isPartOf\":{\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website\"},\"datePublished\":\"2026-11-12T04:12:08+00:00\",\"author\":{\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1\"},\"description\":\"TL;DR: A game server that only exists inside an SSH session dies with the session. Run SteamCMD and the game binary inside tmux or screen so the console\",\"breadcrumb\":{\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website\",\"url\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/\",\"name\":\"Best Dedicated Web Hosting Server Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1\",\"name\":\"bestdedicatedwebhostingserver\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g\",\"caption\":\"bestdedicatedwebhostingserver\"},\"sameAs\":[\"https:\/\/bestdedicatedwebhostingserver.com\/blog\",\"https:\/\/x.com\/bestdedicatedwebhostingserver\"],\"url\":\"https:\/\/bestdedicatedwebhostingserver.com\/blog\/author\/bestdedicatedwebhostingserver\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window - Best Dedicated Web Hosting Server Blog","description":"TL;DR: A game server that only exists inside an SSH session dies with the session. Run SteamCMD and the game binary inside tmux or screen so the console","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/","og_locale":"en_US","og_type":"article","og_title":"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window","og_description":"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window","og_url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/","og_site_name":"Best Dedicated Web Hosting Server Blog","article_published_time":"2026-11-12T04:12:08+00:00","author":"bestdedicatedwebhostingserver","twitter_card":"summary_large_image","twitter_creator":"@bestdedicatedwebhostingserver","twitter_misc":{"Written by":"bestdedicatedwebhostingserver","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/","url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/","name":"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window - Best Dedicated Web Hosting Server Blog","isPartOf":{"@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website"},"datePublished":"2026-11-12T04:12:08+00:00","author":{"@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1"},"description":"TL;DR: A game server that only exists inside an SSH session dies with the session. Run SteamCMD and the game binary inside tmux or screen so the console","breadcrumb":{"@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/tmux-screen-persistent-steam-consoles\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/"},{"@type":"ListItem","position":2,"name":"tmux and screen for Game Servers: Keeping Steam Consoles Alive Past the SSH Window"}]},{"@type":"WebSite","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#website","url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/","name":"Best Dedicated Web Hosting Server Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/6eb5f9ea35033fe8e67df44397e089b1","name":"bestdedicatedwebhostingserver","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/462a07aa37399bdb149e5f91dc3cd8906656bc4c7ed391a3b6f0199c5d2ab964?s=96&d=mm&r=g","caption":"bestdedicatedwebhostingserver"},"sameAs":["https:\/\/bestdedicatedwebhostingserver.com\/blog","https:\/\/x.com\/bestdedicatedwebhostingserver"],"url":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/author\/bestdedicatedwebhostingserver\/"}]}},"_links":{"self":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts\/1662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/comments?post=1662"}],"version-history":[{"count":1,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts\/1662\/revisions"}],"predecessor-version":[{"id":1665,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/posts\/1662\/revisions\/1665"}],"wp:attachment":[{"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/media?parent=1662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/categories?post=1662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bestdedicatedwebhostingserver.com\/blog\/wp-json\/wp\/v2\/tags?post=1662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}