{"id":161,"date":"2019-07-02T19:07:24","date_gmt":"2019-07-02T18:07:24","guid":{"rendered":"https:\/\/banfi.co.uk\/blog\/?p=161"},"modified":"2020-03-20T21:52:03","modified_gmt":"2020-03-20T21:52:03","slug":"teamspeak-in-amazon-aws-ec2","status":"publish","type":"post","link":"https:\/\/banfi.co.uk\/blog\/2019\/07\/teamspeak-in-amazon-aws-ec2\/","title":{"rendered":"Teamspeak in Amazon AWS EC2"},"content":{"rendered":"\n<p>Well for a little 30 minute project I decided to see how well TeamSpeak v3.9.0 runs in Amazon AWS EC2 t2.micro instance. <br><br>This project is based on the Reddit Guide  <a href=\"https:\/\/www.reddit.com\/r\/DotA2\/comments\/2he801\/how_to_easily_setup_your_own_free_teamspeak\/\">https:\/\/www.reddit.com\/r\/DotA2\/comments\/2he801\/how_to_easily_setup_your_own_free_teamspeak\/<\/a>  <br>and this GazBlog Guide &#8211;  <a href=\"https:\/\/www.gazblog.com\/2018\/12\/setup-teamspeak-3-server-on-ubuntu-18-04\/\">https:\/\/www.gazblog.com\/2018\/12\/setup-teamspeak-3-server-on-ubuntu-18-04\/<\/a> <br>but the instructions needed changing slightly due to Teamspeak differences and also I wanted the firewall and SSH access secured.<br><br>My reasons for this is ever since i3d stopped hosting Teamspeak getting a good UK server has proved hard so having a AWS server as a backup \/ used as our main comms server  would be helpful.<\/p>\n\n\n\n<p>Amazon offer 12 months free of a t2.micro instance the cheaper t2.nano is not free at the moment<\/p>\n\n\n\n<p>To try this out for yourself you will need to sign up to Amazon AWS EC2 Services using the following link :   <a href=\"https:\/\/aws.amazon.com\/free\">https:\/\/aws.amazon.com\/free<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/aws.amazon.com\/free\"> <\/a><br>Fill in your details for a Personal account and verify with a Debit or Credit Card<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image.png\" alt=\"\" class=\"wp-image-162\" width=\"95\" height=\"247\" srcset=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image.png 198w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-115x300.png 115w\" sizes=\"auto, (max-width: 95px) 100vw, 95px\" \/><\/figure><\/div>\n\n\n\n<p>Once signed up go to your AWS Console &#8211;  <a rel=\"noreferrer noopener\" href=\"https:\/\/console.aws.amazon.com\/console\/home\" target=\"_blank\">https:\/\/console.aws.amazon.com\/console\/home<\/a> <br>Select the region you want to host your server on &#8211; I used London as I&#8217;m based in the UK<br><\/p>\n\n\n\n<p>Select &#8216;Launch a virtual machine with EC2&#8217;<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"188\" height=\"176\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-1.png\" alt=\"\" class=\"wp-image-163\"\/><\/figure>\n\n\n\n<p>Search for Ubuntu Server 18.04 LTS<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"257\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-2-1024x257.png\" alt=\"\" class=\"wp-image-164\" srcset=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-2-1024x257.png 1024w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-2-300x75.png 300w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-2-768x193.png 768w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-2.png 1208w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Select t2.micro &#8216;Free tier eligible&#8217;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"64\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-3.png\" alt=\"\" class=\"wp-image-165\" srcset=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-3.png 773w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-3-300x25.png 300w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-3-768x64.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/figure>\n\n\n\n<p>Next configure your Instance Details &#8211; I left all settings at Default<br>Next Add Storage &#8211; I used SSD with 8Gb&#8217;s of space for \/dev\/sda1<\/p>\n\n\n\n<p>Next create a Network security group to allow TeamSpeak traffic and also Private SSH traffic back to your Home IP &#8211; I called my Group &#8216; Teamspeak Server Firewall&#8217;<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-5-1024x409.png\" alt=\"\" class=\"wp-image-167\" srcset=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-5-1024x409.png 1024w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-5-300x120.png 300w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-5-768x307.png 768w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-5.png 1126w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now click Review and Launch &#8211; If you get a error can&#8217;t launch, wait another 10 minutes as your account may be waiting verification from Amazon.<\/p>\n\n\n\n<p>Once launched &#8211; Change the first dropdown box to &#8220;Create a new pair&#8221; and give it a name like &#8220;Teamspeak-Access&#8221; and hit &#8220;Download Key Pair&#8221;. Then hit &#8220;Launch Instances&#8221; <\/p>\n\n\n\n<p>Move you private Key to somewhere safe &#8211; as without this you won&#8217;t be able to SSH in to the instance<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Connecting to SSH<\/h2>\n\n\n\n<p>Now I used Putty to connect to the instance &#8211; but there is a Java Client as well which can be used.<br>To use PuTTY, Amazon have some instructions here &#8211;  <a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/putty.html?icmpid=docs_ec2_console\">https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/putty.html?icmpid=docs_ec2_console<\/a> <br>PuTTYgen has to be used to save your Key in to a accepted Putty format<\/p>\n\n\n\n<p>To use the Java Client (Not tested as I don&#8217;t have Java)  &#8211; you need to select connect with Java SSH client. Set the Private key path as  the location you saved you key pair and tick Store in browser cache. Then hit Launch SSH Client <br> Accept the terms for everything,  Press Next a few times. When the MindTerm screen opens, hit &#8220;Enter&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"661\" height=\"418\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-6.png\" alt=\"\" class=\"wp-image-168\" srcset=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-6.png 661w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-6-300x190.png 300w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><figcaption>Connected!<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Setup Teamspeak 3 server on Ubuntu 18.04 <\/h2>\n\n\n\n<p>Run the following via SSH to upgrade your Distro<br><code>sudo apt-get update<\/code><br><code>sudo apt-get upgrade<\/code><br><code>sudo apt-get dist-upgrade<\/code> <\/p>\n\n\n\n<p>Next create a user to run Teamspeak using the following command<br><code>sudo adduser --disabled-login teamspeak <br>sudo su teamspeak<br>cd \/home\/teamspeak<\/code><\/p>\n\n\n\n<p> Run the following commands to:<br>Download Teamspeak, extract it and tidy up. <br><code>wget https:\/\/files.teamspeak-services.com\/releases\/server\/3.9.0\/teamspeak3-server_linux_amd64-3.9.0.tar.bz2<\/code><br><code>tar xvfj teamspeak3-server_linux_amd64-3.9.0.tar.bz2<\/code><br><code>cd teamspeak3-server_linux_amd64<\/code><br><code>cp * -R \/home\/teamspeak<\/code><br><code>cd ..<\/code><br><code>rm -r teamspeak3-server_linux_amd64<\/code><br><code>rm teamspeak3-server_linux_amd64-3.9.0.tar.bz2<\/code><br><code>touch .ts3server_license_accepted<\/code> <\/p>\n\n\n\n<p>Next start the TS3 Server with the following command<br>  .\/ts3server_startscript.sh start <br>It should start up &#8211; copy out the text that spits out as it will contain your access token and Server Query admin account details &#8211; Don&#8217;t lose it!<br><br>Press Enter to return to the command prompt<br>Finally stop the server and Exit the Teamspeak user with the following commands<br> <code>.\/ts3server_startscript.sh stop<\/code><br><code>exit<\/code> <\/p>\n\n\n\n<p>Now we will create a restart script using systemd to restart it on boot.<br>Run the below command (This should open a blank pape) <br>sudo nano \/lib\/systemd\/system\/ts3server.service <\/p>\n\n\n\n<p>Copy the below and paste it:<\/p>\n\n\n\n<p><code>[Unit]<\/code><br><code>Description=Teamspeak Service<\/code><br><code>Wants=network.target<\/code><br><br><code>[Service]<\/code><br><code>WorkingDirectory=\/home\/teamspeak<\/code><br><code>User=teamspeak<\/code><br><code>ExecStart=\/home\/teamspeak\/ts3server_minimal_runscript.sh<\/code><br><code>ExecStop=\/home\/teamspeak\/ts3server_startscript.sh stop<\/code><br><code>ExecReload=\/home\/teamspeak\/ts3server_startscript.sh restart<\/code><br><code>Restart=always<\/code><br><code>RestartSec=15<\/code> <br><br><code>[Install]<\/code><br><code>WantedBy=multi-user.target<\/code> <\/p>\n\n\n\n<p>Now we need to save it<br>Press CTRL and X together, then Press Y<\/p>\n\n\n\n<p>Now we need to enable it, by typing in the following command<br>systemctl enable ts3server.service <br><br>Type the following to reboot you server<br>sudo reboot <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Connecting to the TeamSpeak instance<\/h2>\n\n\n\n<p>Connect using your Public DNS bookmark &#8211; for example ec2-somedetails-.eu-west-2.compute.amazonaws.com<\/p>\n\n\n\n<p>Then claim ownership using the Teamspeak client with your access Token (Right click &#8211; Manage Virtual Server)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"465\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-7.png\" alt=\"\" class=\"wp-image-169\" srcset=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-7.png 868w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-7-300x161.png 300w, https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-7-768x411.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"241\" height=\"23\" src=\"https:\/\/banfi.co.uk\/blog\/wp-content\/uploads\/2019\/07\/image-8.png\" alt=\"\" class=\"wp-image-170\"\/><\/figure><\/div>\n\n\n\n<p>And the performance seems great<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well for a little 30 minute project I decided to see how well TeamSpeak v3.9.0 runs in Amazon AWS EC2 t2.micro instance. This project is based on the Reddit Guide https:\/\/www.reddit.com\/r\/DotA2\/comments\/2he801\/how_to_easily_setup_your_own_free_teamspeak\/ and this GazBlog Guide &#8211; https:\/\/www.gazblog.com\/2018\/12\/setup-teamspeak-3-server-on-ubuntu-18-04\/ but the instructions needed changing slightly due to Teamspeak differences and also I wanted the firewall and SSH &hellip; <a href=\"https:\/\/banfi.co.uk\/blog\/2019\/07\/teamspeak-in-amazon-aws-ec2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Teamspeak in Amazon AWS EC2<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23,24,25],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-aws","category-ec2","category-teamspeak"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":4,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":184,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/posts\/161\/revisions\/184"}],"wp:attachment":[{"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/banfi.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}