{"id":11152,"date":"2024-06-24T03:28:43","date_gmt":"2024-06-24T00:28:43","guid":{"rendered":"https:\/\/sunucun.com.tr\/bilgi\/?post_type=dt_articles&#038;p=11152"},"modified":"2026-11-12T13:27:19","modified_gmt":"2026-11-12T10:27:19","slug":"virtual-server-setup-and-management","status":"publish","type":"post","link":"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/","title":{"rendered":"Virtual Server (VPS) Setup: What to Do in the First 30 Minutes"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_90 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#Before_Setup_Choosing_Resources_and_an_Operating_System\" >Before Setup: Choosing Resources and an Operating System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#1_Connect_to_the_Server_over_SSH\" >1. Connect to the Server over SSH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#2_Update_the_System\" >2. Update the System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#3_Create_a_User_with_sudo_Rights\" >3. Create a User with sudo Rights<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#4_Switch_to_SSH_Key_Login\" >4. Switch to SSH Key Login<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#5_Disable_Root_and_Password_Login\" >5. Disable Root and Password Login<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#6_Enable_the_Firewall\" >6. Enable the Firewall<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#7_Automatic_Security_Updates_Time_Zone_and_Hostname\" >7. Automatic Security Updates, Time Zone and Hostname<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#8_Install_Your_Applications_and_Set_Up_Backups\" >8. Install Your Applications and Set Up Backups<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#Differences_on_a_Windows_Virtual_Server\" >Differences on a Windows Virtual Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#Management_After_Setup_A_Short_Checklist\" >Management After Setup: A Short Checklist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-and-management\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n<p class=\"wp-block-paragraph\">A virtual server (<a href=\"https:\/\/sunucun.com.tr\/vps-sunucu\" data-internallinksmanager029f6b8e52c=\"132\" title=\"Sanal sunucu se\u00e7eneklerini inceleyin\">VPS<\/a>) is a server created by splitting a physical server through virtualization, with its own operating system, root access and dedicated resources. The provider delivers the server in a few minutes, but making it secure and ready to use is your job. In this guide we walk through what to do on a new virtual server, from the first connection to the security settings, using Ubuntu; we also cover the differences for Windows servers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Before_Setup_Choosing_Resources_and_an_Operating_System\"><\/span>Before Setup: Choosing Resources and an Operating System<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The right starting plan depends on what you will run on the server. The table below is a general starting point; real needs vary with traffic and the application:<\/p>\n\n\n\n<div class=\"snc-table-wrap\"><table>\n<thead><tr><th>Use case<\/th><th>Recommended operating system<\/th><th>What to watch at the start<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>WordPress or a PHP site<\/td><td>Ubuntu LTS, Debian, AlmaLinux<\/td><td>Enough RAM for the database, SSD\/NVMe disk<\/td><\/tr>\n<tr><td>Node.js, Python, Docker applications<\/td><td>Ubuntu LTS, Debian<\/td><td>RAM based on the number of apps and containers<\/td><\/tr>\n<tr><td>Remote desktop, Windows software, .NET\/IIS<\/td><td>Windows Server<\/td><td>At least 2 GB RAM for Windows Server; more for desktop use<\/td><\/tr>\n<tr><td>Game server, bot, VPN<\/td><td>Ubuntu LTS or Debian<\/td><td>CPU speed, network latency and traffic limit<\/td><\/tr>\n<\/tbody><\/table><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">On Linux, choosing a long-term support (LTS) release means you get security updates for years. You can find the differences between a virtual and a physical server in our <a href=\"https:\/\/sunucun.com.tr\/blog\/comparison-of-virtual-private-servers-vps-and-dedicated-servers\/\">VPS vs dedicated server comparison<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Connect_to_the_Server_over_SSH\"><\/span>1. Connect to the Server over SSH<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When the server is delivered you receive an IP address and a root password (or an SSH key). On Windows 10\/11, macOS and Linux you can connect directly from a terminal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh root@SERVER_IP<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On the first connection you are asked to confirm the server&#8217;s fingerprint. If you can&#8217;t connect over SSH, use the VNC\/console screen in your provider&#8217;s panel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Update_the_System\"><\/span>2. Update the System<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update &amp;&amp; apt upgrade -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This installs the security updates released after the installation image was built. If the kernel was updated, restart the server with <code>reboot<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Create_a_User_with_sudo_Rights\"><\/span>3. Create a User with sudo Rights<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Doing daily work as a sudo user instead of root limits the impact of a wrong command and lets you disable root login:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>adduser admin\nusermod -aG sudo admin<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On Debian and Ubuntu the privileged group is <code>sudo<\/code>; on AlmaLinux and Rocky Linux it is <code>wheel<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Switch_to_SSH_Key_Login\"><\/span>4. Switch to SSH Key Login<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using an SSH key instead of a password makes brute-force password attempts useless. Create the key <strong>on your own computer<\/strong> and copy it to the server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># On your own computer\nssh-keygen -t ed25519\nssh-copy-id admin@SERVER_IP<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On systems without <code>ssh-copy-id<\/code>, add the contents of <code>~\/.ssh\/id_ed25519.pub<\/code> to <code>\/home\/admin\/.ssh\/authorized_keys<\/code> on the server. Then confirm that <code>ssh admin@SERVER_IP<\/code> logs you in without a password.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Disable_Root_and_Password_Login\"><\/span>5. Disable Root and Password Login<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once key login works, set these lines in <code>\/etc\/ssh\/sshd_config<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PermitRootLogin no\nPasswordAuthentication no<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On some images, files in the <code>\/etc\/ssh\/sshd_config.d\/<\/code> folder (for example the cloud-init file on cloud images) can override these settings, so check that folder too. Then test the configuration and restart the service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sshd -t\nsudo systemctl restart ssh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Try logging in from a second terminal before closing your current session. If something goes wrong, you can fix it from the open session. The service is called <code>ssh<\/code> on Ubuntu and Debian and <code>sshd<\/code> on RHEL-based distributions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Enable_the_Firewall\"><\/span>6. Enable the Firewall<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On Ubuntu, use UFW to open only the ports you need. Add the SSH rule <strong>before<\/strong> enabling the firewall, or your connection will drop:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow OpenSSH\nsudo ufw allow 80\/tcp\nsudo ufw allow 443\/tcp\nsudo ufw enable\nsudo ufw status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On AlmaLinux and Rocky Linux, <code>firewalld<\/code> (<code>firewall-cmd<\/code>) does the same job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_Automatic_Security_Updates_Time_Zone_and_Hostname\"><\/span>7. Automatic Security Updates, Time Zone and Hostname<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install unattended-upgrades\nsudo dpkg-reconfigure --priority=low unattended-upgrades\nsudo timedatectl set-timezone Europe\/Istanbul\nsudo hostnamectl set-hostname server1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Automatic updates make sure security patches are installed even if you forget. The correct time zone makes logs and scheduled tasks easier to read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Install_Your_Applications_and_Set_Up_Backups\"><\/span>8. Install Your Applications and Set Up Backups<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After the basic settings you can install the software you need: Nginx or Apache, PHP and MySQL\/MariaDB for a website; Node.js, Python or Docker for applications. If you want easier management, you can also install a control panel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The last and most often skipped step is backup. The provider&#8217;s snapshot feature is useful for a quick rollback, but it isn&#8217;t enough on its own; keep a regular, tested backup of your database and files outside the server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Differences_on_a_Windows_Virtual_Server\"><\/span>Differences on a Windows Virtual Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You connect with Remote Desktop (RDP) instead of SSH: on Windows, open Remote Desktop Connection with the <code>mstsc<\/code> command and connect with the IP address and Administrator credentials.<\/li>\n<li>The first tasks are installing updates through Windows Update and changing the Administrator password to a strong one.<\/li>\n<li>Allowing access to the RDP port (3389) only from your own IP addresses in the firewall greatly reduces password attempts.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Management_After_Setup_A_Short_Checklist\"><\/span>Management After Setup: A Short Checklist<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Monitor disk, RAM and CPU usage regularly (<code>df -h<\/code>, <code>free -m<\/code>, <code>htop<\/code>).<\/li>\n<li>Check weekly that updates and backups are actually happening.<\/li>\n<li>Turn off services and ports you don&#8217;t use.<\/li>\n<li>Take a snapshot before important changes.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For more management tips, see our article on <a href=\"https:\/\/sunucun.com.tr\/blog\/best-practices-managing-virtual-servers\/\">best practices for managing virtual servers<\/a>, and if you want to build a virtualization platform, our guide to <a href=\"https:\/\/sunucun.com.tr\/blog\/virtual-server-setup-on-vmware-esxi\/\">virtual server setup on VMware ESXi<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up a virtual server doesn&#8217;t end when the provider hands it over. Installing updates, switching to a sudo user and SSH keys, disabling root and password login, enabling the firewall and setting up backups can all be done in the first half hour and make your server much more secure. If you want to start with a server with root access, take a look at our <a href=\"https:\/\/sunucun.com.tr\/en\/vps-server\">VPS server<\/a> and <a href=\"https:\/\/sunucun.com.tr\/en\/vds-server\">VDS server<\/a> plans.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A virtual server (VPS) is a server created by splitting a physical server through virtualization, with its own operating system, root access and dedicated resources. The provider delivers the server in a few minutes, but making it secure and ready to use is your job. In this guide we walk through what to do on&hellip;<\/p>\n","protected":false},"author":1,"featured_media":11113,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1519],"tags":[1527],"class_list":["post-11152","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sanal-sunucu","tag-teknoloji"],"_links":{"self":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts\/11152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/comments?post=11152"}],"version-history":[{"count":2,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts\/11152\/revisions"}],"predecessor-version":[{"id":20120,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/posts\/11152\/revisions\/20120"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/media\/11113"}],"wp:attachment":[{"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/media?parent=11152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/categories?post=11152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunucun.com.tr\/blog\/wp-json\/wp\/v2\/tags?post=11152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}