{"id":531,"date":"2013-01-06T23:18:46","date_gmt":"2013-01-06T23:18:46","guid":{"rendered":"http:\/\/www.nooblet.org\/blog\/?p=531"},"modified":"2013-10-21T09:12:20","modified_gmt":"2013-10-21T09:12:20","slug":"installing-tshock-terraria-server-on-debian-wheezy","status":"publish","type":"post","link":"https:\/\/www.nooblet.org\/blog\/2013\/installing-tshock-terraria-server-on-debian-wheezy\/","title":{"rendered":"Installing TShock Terraria Server on Debian Wheezy"},"content":{"rendered":"<p>The following is how I installed TShock Terraria Server on a clean Debian Wheezy machine. The same method has been tested working on Ubuntu 12.04 LTS (Precise).<\/p>\n<p>One important difference to other howtos is it <strong>does not install mono-complete<\/strong> and the plethora of dependencies that requires (including x11-common). This only installs the required libraries to run, nothing more.<\/p>\n<p>Run these commands individually, this is not to be copy pasted into your shell in full.<\/p>\n<p><strong>Update:<\/strong> A few users are complaining of missing packages, however I have re-run the instructions in a fresh Wheezy guest and found no issues (see transcript of installation <a href=\"https:\/\/www.nooblet.org\/files\/terraria-wheezy-install.txt\">here<\/a>).<\/p>\n<p><strong>Update2:<\/strong> I have successfully tested the following instructions using Ubuntu 12.04 LTS Precise (transcript <a href=\"https:\/\/www.nooblet.org\/files\/terraria-precise-install.txt\">here<\/a>)<\/p>\n<p><strong>Update3:<\/strong> Tested working with TShock 4.2<\/p>\n<p><strong>Make sure you are using Debian 7 Wheezy or Ubuntu 12.04 LTS Precise.<\/strong><\/p>\n<pre class=\"lang:shell decode:true \" >\r\n# Need root\r\nsudo su -\r\n\r\n# Install dependancies\r\napt-get update && apt-get install unzip screen \\\r\n   mono-runtime libmono-system-core4.0-cil libmono-sqlite4.0-cil libmysql-cil-dev \\\r\n   libmono-system-runtime-serialization4.0-cil libmono-web4.0-cil libmono-system-xml-linq4.0-cil\r\n\r\n# Add terraria group and user\r\nsudo groupadd --gid 70001 terraria\r\nsudo useradd --gid 70001 -d \/home\/terraria -m --uid 70001 -s \/bin\/bash terraria\r\n\r\n# Change user to terraria\r\nsu terraria\r\n# Make and change to bin folder\r\nmkdir ~\/bin\r\ncd ~\/bin\r\n\r\n# Download and extract TShock Terraria Server\r\nwget http:\/\/cloud.github.com\/downloads\/TShock\/TShock\/TShock-4.0.zip\r\nunzip TShock-4.0.zip\r\n\r\n# Fix case-insensitive folder\r\nln -s serverplugins ServerPlugins\r\n\r\n# Run Terraria for first time, create world\r\n# (note down auth code for admin access, and exit-nosave)\r\nmono TerrariaServer.exe -ip 0.0.0.0 -port 7777 -maxplayers 8\r\n# Change server password\r\nTERRARIAPASSWORD=\"password\";\r\nsed -i \"s\/(\"ServerPassword\": \")[^\"]*(\",)$\/1${TERRARIAPASSWORD}2\/\" tshock\/config.json\r\n\r\n# Terraria is now installed, keep reading to setup startup init script\r\n\r\n# Go back to root\r\nexit\r\n\r\n# Download init script to \/etc\/init.d\/\r\nwget -O \/etc\/init.d\/terraria-server http:\/\/www.nooblet.org\/blog\/download\/terraria-init.sh\r\n# Fix permissions\r\nchmod +x \/etc\/init.d\/terraria-server\r\n# Insert to startup\r\ninsserv -v \/etc\/init.d\/terraria-server\r\n\r\n# At this point you may want to edit the init script if you are using a\r\n# different world-file or server-port\r\n# Also by default, the script does not save on exit, see variable: EXIT_COMMAND\r\n\r\n# Start the server\r\ninvoke-rc.d terraria-server start\r\n\r\n# Check its running in screen (press Ctrl-a then d to exit)\r\ninvoke-rc.d terraria-server connect<\/pre>\n<h1>Debian init-script<\/h1>\n<p>The following init-script can:<\/p>\n<ul>\n<li>Connect to the screen console with .\/terraria-server connect<\/li>\n<li>Exits the server cleanly by issuing the &#8220;exit&#8221; or &#8220;exit-nosave&#8221; command to the server console<\/li>\n<li>Fits perfectly if installation was made by the above howto<\/li>\n<\/ul>\n<p><b>Download<\/b><br \/>\n<img decoding=\"async\" src=\"\/blog\/wp-content\/plugins\/wp-downloadmanager\/images\/ext\/unknown.gif\" alt=\"\" title=\"\" style=\"vertical-align: middle;\" \/>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/terraria-init.sh\">terraria-init.sh<\/a><\/strong> (2.6 KiB, 5,238 hits)<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following is how I installed TShock Terraria Server on a clean Debian Wheezy machine. The same method has been tested working on Ubuntu 12.04 LTS (Precise). One important difference to other howtos is it does not install mono-complete and the plethora of dependencies that requires (including x11-common). This only installs the required libraries to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":640,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5],"tags":[233,145,157,160],"class_list":["post-531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-games","category-linux","tag-linux","tag-server","tag-terraria","tag-tshock"],"_links":{"self":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/comments?post=531"}],"version-history":[{"count":8,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/531\/revisions"}],"predecessor-version":[{"id":960,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/531\/revisions\/960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media\/640"}],"wp:attachment":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media?parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/categories?post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/tags?post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}