How to Create Your First VPS on DigitalOcean: A Step-by-Step Guide
In this post, I will walk you through the process of setting up your first Linux Virtual Private Server (VPS) on DigitalOcean. DigitalOcean is renowned for its 1-click installation process, global network of data centers, and reliable service, all at an affordable starting point of $5/month. As a senior developer who frequently utilizes DigitalOcean for various services, I highly recommend it.
Step 1: Create a DigitalOcean Account
To get started, use this affiliate link and receive a $100 credit to be used within 60 days. Please note that I will receive a $25 credit when you sign up using this link. Fill out the registration form on the website, or choose to sign up with your Google or GitHub account. Confirm your email and provide the necessary billing information to receive your $100 credit upon completion.
Step 2: Create a Project
Once registered, create a new project by entering a name and a description. This will bring you to the Project Dashboard, which will serve as your control center for all your project-related tasks. To create a Droplet (a virtual machine or VPS), click the blue button labeled “Get Started with a Droplet.”
Create a Droplet
On the Droplet creation page, you will find various options to choose from. Start by selecting the Linux distribution of your choice, such as Ubuntu, Fedora, Debian, CentOS, or even FreeBSD. You can also opt to install a preconfigured server with popular applications like WordPress, Ghost, or a LAMP server using the Marketplace feature. If you have an existing server, you can create a Droplet from a snapshot, backup, or custom image.
Once you have made your selections, proceed to choose a plan. DigitalOcean offers Standard, CPU-Optimized, and Memory-Optimized plans at different price points. Consider your requirements and budget when making a selection. Keep in mind that billing is per hour, so you will only be billed for the actual usage.
To further customize your Droplet, you can add block storage for persistent data storage and select a data center region. Choose the data center nearest to your target audience for optimal performance.
For authentication, you can either choose to use a password or SSH keys. While using passwords is simpler, I recommend SSH keys for enhanced security, especially on real servers. Set a password for the root user and enter a meaningful username.
Click the “Create Droplet” button to initiate the creation process. DigitalOcean will generate a public server IP address upon completion. By clicking on the name of the Droplet, you can access the Droplet dashboard, which gives you full control over your server.
Access the Droplet as Root
To access the Droplet, click on the “Access” menu and select the “Launch Console” button. A login window will open within your browser. Enter “root” as the username and the password you set earlier to log in to the server. Alternatively, you can use your operating system’s terminal for better control. For example, on macOS, you can use the Terminal app and enter the command ssh root@<IP ADDRESS>
to log in to the server.
What’s Next?
Congratulations! You now have complete control over a computer located in a data center. This is just the beginning, and there are several essential steps you should take before your server is ready for use. First, create a user that is not root, secure your server, and configure any desired software you plan to run.
Tags: DigitalOcean, VPS, Linux, Droplet, Server Setup, Cloud Computing