{"id":15950,"date":"2024-10-28T12:23:30","date_gmt":"2024-10-28T12:23:30","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=15950"},"modified":"2024-10-28T12:51:28","modified_gmt":"2024-10-28T12:51:28","password":"","slug":"setting-up-your-first-linux-server-a-step-by-step-guide","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/","title":{"rendered":"Setting Up Your First Linux Server: A Step-by-Step Guide"},"content":{"rendered":"\n<p>Setting up your first Linux server is an exciting step into the world of server management. Linux servers are known for their stability, security, and flexibility, making them an excellent choice for hosting applications, websites, databases, and more. <\/p>\n\n\n\n<p>Here\u2019s a comprehensive step-by-step guide to help you get started.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 1: Choose a Linux Distribution<\/strong><\/h5>\n\n\n\n<p>The first step is selecting a Linux distribution. The most popular choices for server environments are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ubuntu Server<\/strong>: Known for ease of use and excellent support, Ubuntu Server is widely used and has robust community and enterprise backing.<\/li>\n\n\n\n<li><strong>AlmaLinux\/<strong>CentOS<\/strong><\/strong>\/<strong>Rocky Linux<\/strong>: These are often preferred for enterprise environments, especially where compatibility with Red Hat Enterprise Linux (RHEL) is desired. <\/li>\n\n\n\n<li><strong>Debian<\/strong>: Known for its stability and extensive software repository<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 2: Provision Your Server<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you\u2019re using a hosting provider like <strong><a href=\"https:\/\/truehost.cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\">Truehost Cloud<\/a><\/strong>, provision your server through their control panel:\n<ul class=\"wp-block-list\">\n<li>Choose the server type and plan.<\/li>\n\n\n\n<li>Select the server location.<\/li>\n\n\n\n<li>Choose the distribution version.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The server will be automatically provisioned. IN case you find a delay with provisioning, please check with our <strong><a href=\"https:\/\/wa.me\/19726743814\" target=\"_blank\" rel=\"noreferrer noopener\">support team<\/a><\/strong>.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 3: Access Your Server via SSH<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After provisioning, note your server\u2019s IP address and SSH credentials. Use them to access SSH as guide in <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-access-a-server-via-ssh-terminal\/\" target=\"_blank\" rel=\"noreferrer noopener\">these steps.<\/a><\/strong><\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 4: Update the Server<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Before installing anything, make sure your server is up to date. <\/li>\n\n\n\n<li>Based on your Operating System, use the commands below to update<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo apt update &amp;&amp; sudo apt upgrade -y # For Ubuntu\/Debian<\/strong>\n<strong>\nsudo yum update -y # For AlmaLinux\/CentOS\/Rocky<\/strong><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"306\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png\" alt=\"\" class=\"wp-image-15977\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579-300x120.png 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 5: Set Up a Basic Firewall<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Linux servers typically come with <strong>UFW (Uncomplicated Firewall)<\/strong> on Ubuntu or <strong>firewalld<\/strong> on CentOS\/AlmaLinux.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>For Ubuntu<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow OpenSSH\nsudo ufw enable\nsudo ufw status<\/code><\/pre>\n\n\n\n<p>2. For CentOS\/AlmaLinux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start firewalld\nsudo firewall-cmd --permanent --add-service=ssh\nsudo firewall-cmd --reload\nsudo firewall-cmd --list-all<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Verify Firewall Status<\/strong>: Confirm that your firewall rules are configured correctly to allow SSH access.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 6: Create a New User<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For security, avoid working as the <code>root<\/code> user. Create a new user with sudo privileges.<\/li>\n\n\n\n<li>Use <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-create-a-sudo-user-on-your-server\/\" target=\"_blank\" rel=\"noreferrer noopener\">these steps<\/a><\/strong> to do that<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 7: Set Up SSH Key Authentication (Optional but Recommended)<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using SSH keys instead of passwords significantly enhances security.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Please refer to <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-configure-ssh-key-for-a-user\/\" target=\"_blank\" rel=\"noreferrer noopener\">these steps<\/a><\/strong> on how to configure SSH keys<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 8: Monitor Server Performance<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install monitoring tools to keep track of server health:<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Install Fail2Ban<\/strong> for protection against brute-force attacks:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Please refer to <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-secure-a-linux-server-with-fail2ban\/\" target=\"_blank\" rel=\"noreferrer noopener\">this article<\/a><\/strong> on how to install and configure fail2ban<\/li>\n<\/ul>\n\n\n\n<p>   2. <strong>Top\/htop<\/strong> for resource monitoring:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install htop -y  # Ubuntu\/Debian\n\nsudo yum install htop -y  # AlmaLinuxCentOS<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Step 9: Final Security Checks<\/strong><\/h5>\n\n\n\n<p>You can make your server even more secure by enforcing extra security measures<\/p>\n\n\n\n<p><strong>Disable Root SSH Login<\/strong> <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can use <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-disable-root-ssh-completely\/\" target=\"_blank\" rel=\"noreferrer noopener\">these steps<\/a><\/strong> to disable root ssh login and only allow ssh with sudo user.<\/li>\n<\/ul>\n\n\n\n<p><strong>Change SSH port to a custom port<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can use <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-change-ssh-port-to-a-custom-port\/\" target=\"_blank\" rel=\"noreferrer noopener\">these steps<\/a><\/strong> to change the SSH port from the default 22, and set a custom one.<\/li>\n<\/ul>\n\n\n\n<p>With those steps, your Linux server is now set up, secured, and ready for production use. Remember to monitor performance, stay on top of security updates, and back up your data regularly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up your first Linux server is an exciting step into the world of server management. Linux servers are known for their stability, security, and flexibility, making them an excellent choice for hosting applications, websites, databases, and more. Here\u2019s a comprehensive step-by-step guide to help you get started. Step 1: Choose a Linux Distribution The [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,1824,1879,2128],"doc_tag":[],"class_list":["post-15950","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-07","word_count":519,"total_views":"0","reactions":{"happy":"0","normal":"0","sad":"1"},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setting Up Your First Linux Server: A Step-by-Step Guide -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Up Your First Linux Server: A Step-by-Step Guide -\" \/>\n<meta property=\"og:description\" content=\"Setting up your first Linux server is an exciting step into the world of server management. Linux servers are known for their stability, security, and flexibility, making them an excellent choice for hosting applications, websites, databases, and more. Here\u2019s a comprehensive step-by-step guide to help you get started. Step 1: Choose a Linux Distribution The [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-28T12:51:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/\",\"name\":\"Setting Up Your First Linux Server: A Step-by-Step Guide -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-579.png\",\"datePublished\":\"2024-10-28T12:23:30+00:00\",\"dateModified\":\"2024-10-28T12:51:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-579.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-579.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/setting-up-your-first-linux-server-a-step-by-step-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Up Your First Linux Server: A Step-by-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting Up Your First Linux Server: A Step-by-Step Guide -","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:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/","og_locale":"en_US","og_type":"article","og_title":"Setting Up Your First Linux Server: A Step-by-Step Guide -","og_description":"Setting up your first Linux server is an exciting step into the world of server management. Linux servers are known for their stability, security, and flexibility, making them an excellent choice for hosting applications, websites, databases, and more. Here\u2019s a comprehensive step-by-step guide to help you get started. Step 1: Choose a Linux Distribution The [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/","article_modified_time":"2024-10-28T12:51:28+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/","name":"Setting Up Your First Linux Server: A Step-by-Step Guide -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png","datePublished":"2024-10-28T12:23:30+00:00","dateModified":"2024-10-28T12:51:28+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-579.png"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/setting-up-your-first-linux-server-a-step-by-step-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"Setting Up Your First Linux Server: A Step-by-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/15950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=15950"}],"version-history":[{"count":16,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/15950\/revisions"}],"predecessor-version":[{"id":15978,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/15950\/revisions\/15978"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=15950"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=15950"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=15950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}