3 Ways to Set Up a Linux Server on Alibaba Cloud

简介: Find out how you can quickly and easily set up a Linux server on Alibaba Cloud ECS. This tutorial is designed for first-time users of Alibaba Cloud.

By Bin Chen, Alibaba Cloud Tech Share Author

If you are new to Alibaba Cloud, you might wonder, "How can I purchase and set up a server on Alibaba Cloud?" Well, then this article is for you!

In this tutorial, I will be showing you three different ways that you can get a Linux server on Alibaba Cloud. Why Linux? Well, it's just my favorite operating system (OS). You can also refer these steps to purchase a Windows server as they are almost identical. Below is a table that summarizes the different methods as well as their advantages and disadvantages.

Method Advantage Disadvantage
Alibaba Cloud Marketplace Fastest way to get a functional stack. Less customizable.
ECS Starter Package Cost-effective for large data transfers. Fixed billing method.
ECS Console Everything is customizable. Can be difficult for beginners.


Method 1: Alibaba Cloud Marketplace

This is by far the easiest and fastest way to get not only a Linux server but also a fully functional software stack. All you need to do is visit the Alibaba Cloud Marketplace, find your desired product, click on it, and complete your purchase. That's it!

Method 2: ECS Starter Package

If you are planning to host a dynamic website, and you have specific bandwidth requirements, then the ECS Starter Package is your answer! Just select your favorite package and select your desired configurations. I will not cover the steps here, but if you are interested to know more, you can check out the Starter Package Tutorial.

Method 3: ECS Console 

This method can be a little intimidating for new users, but it is not as complicated as you would expect. You are not required to have any background in cloud computing, but if you have used products from other cloud providers, the steps should be pretty similar.

$300 Free Credit

A huge bonus of manually setting up your server is that you can take advantage of the $300 Free Credit for new Alibaba Cloud users. This is a great option for users who want to try out the various configurations or regions of Alibaba Cloud ECS instances.

ECS Console

Once you get your account set up, log into the Alibaba Cloud console. Then, head on to the ECS console by navigating through the Products tab on the top left corner. Proceed to the ECS purchase page by clicking on a cart icon. For now, just click on any cart icons as we will be able to change the region in the purchase page.

08c018ee54ebeb9d01f827eb6fc523f08e81d435

You will then be able to see this screen.

7a11ab0d7bc9f0dcd2d3e3ac9d9db7c59eda106d

Basic Configurations

There are a few things that you should consider when setting up your ECS server.

Item Description
Billing Method There are two billing methods: Subscription (prepaid) and Pay-As-You-Go (post-paid). PAYG is a great option for those who want to experiment on ECS servers.
Region Each region is a separate geographic area. The choice of region affects network latency. Your server is also subject to the necessary security and compliance laws according to its jurisdiction.
Instance Type Basically how powerful you want your server to be (depends on your application).
Image The operating system (OS), which in our case would be Linux.
Storage System storage. Note that if you want to store large files such as multimedia files, then you should look at Object Storage Service (OSS) instead.

Note: Please refer to this page for a list of regions. Not all features are services are available across all regions.

Since we are selecting Linux, let us explore some of the options provided by Alibaba Cloud. ECS supports most traditional Linux distributions: in the deb family, it supports Debian and Ubuntu; in the rpm family, it supports Open Suse and CentOs. However, Fedora and RHEL are not supported at the moment. There is also a so-called container Linux such as CoreOs, which is Gentoo based. Last but not least, there is the Alibaba Cloud developed Aliyun Linux. Each distribution has its own advantages, but I have to explore them in further detail to know more.

The choice of distribution is mostly dependent on lots of factors, such as legacy product environment, commercial support vs community support, application architecture (coreOS is a good chooice if you structure your applications as containers). In our case, it doesn't really matters and we will choose Ubuntu version 14.04.

Networking

In this section, you can customize your network according to your needs. For VPC, we can just stick with the default. In every VPC, there is a virtual device called a VSwitch. VSwitches are used for connecting different cloud product instances (or subnets) in a VPC.

In the Network Billing Method item, select Assign Public IP if you want your instance to connect to the internet. Select your desired bandwidth. If you have high traffic requirements, consider purchasing the ECS Starter Package.

Security Groups are just a way to control connection requests to your server, similar to a firewall. Just go with the default one, which allows access to port 22 (required by SSH protocol) since we need it to connect to the instance. You can always reconfigure this after completing your purchase.

System Configurations

In this section, you will be setting up the ways that you will be connecting to your instance. There are two options: Key Pair and Password. The password option is pretty straightforward but might not be the most secure way.

If you're comfortable with using SSH, then you should definitely try using key pairs. You would need to create a key pair first by clicking on the link on the console.

f88d7d40daead2e46c866f6020ce38d75f2a21aa

You can also do this later by choosing Set Later, but why wait?

Give your key a name, say "myaliKey". The console will create a key pair and automatically download a file “myaliKey.pem” to your local host. Save it for late use. Go back to the instance creating page, click the refresh icon, and find the SSH key in the drop-down list.

Server Name, Description, and Host are a few places you can provide more information to distinguish the instances. It is worth noting that the Host will be the host name after we SSH to the instance. Let’s call it "myalihost" and connect to it later.

There is Item called Advanced (based on instance RAM roles or cloud-init). This is the place you can set the instance bootstrap code, but we won't be using it for now.

Grouping

You can optionally tag your instance for easy management here. We can safely ignore this steps for now.

Review and Launch

If you're satisfied, agree to the Terms of Service and select Create Instance. A pop up will show, telling you the instance is activated. You can either continue creating more instance or go to the instance console (or dashboard).

9c7ba8ef2a70fdb2230fc604b4c21f0fb15c495c

Connecting to ECS

Find out the public IP of the instance from the instance console. My instance IP is 47.91.47.36. Locate the SSH key downloaded previously, and set the correct permission for the SSH key.

$ chmod 600 myaliKey.pem

If you don't set the correct permissions, you will receive the following error message.

$ ssh -i myaliKey.pem root@47.91.47.36
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'myaliKey.pem' are too open.

It is required that your private key files are NOT accessible by others.

This private key will be ignored.

bad permissions: ignore key: myaliKey.pem

After setting the right permissions, you are all good to go. Congratulations, you have just created a Linux (Ubuntu) instance on Alibaba Cloud! You are now able to connect to it securely using SSH from your local host. You should be able to see something like this after logging in.

$ ssh -i myaliKey.pem root@47.91.47.36

Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 4.4.0-93-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

Welcome to Alibaba Cloud Elastic Compute Service !

root@myalihost:~# ls

Cleanup

But wait, there is one more thing to do before you celebrate. If you are only using testing out the ECS instances, remember to release (destroy) the resources. Although you won't be charge for a stopped instance, you may still be charged for idle but "unstopped" instances. This means that your server is costing you money even when it is actually doing nothing.

All you need to do is to find and click on the Release Settings button. You can find this button by clicking on More. 

1bf97a7782d7ec9e87ccdc2605624663e9013126

That's it! Now, you are free to explore other Alibaba Cloud products.

Relevant Tutorials

If you want to learn more about setting up an Alibaba Cloud ECS instance, visit the official documentation page at https://www.alibabacloud.com/help/doc-detail/25422.htm.

If you want to deploy a LEMP stack on Alibaba Cloud, I strongly suggest reading this tutorial by another Tech Share author.

目录
相关文章
|
7月前
|
监控 关系型数据库 MySQL
Alibaba Cloud Linux基础入门(1)——配置zabbix
该文档是关于在Alibaba Cloud Linux上配置Zabbix的教程。首先,通过添加Zabbix仓库并安装相关软件包(如zabbix-server,web前端和agent)。然后,安装并启动MySQL数据库,执行`mysql_secure_installation`进行配置。接着,创建名为zabbix的数据库和用户,并导入Zabbix默认数据。最后,设置Zabbix服务开机自启动,并通过浏览器访问http://服务器IP/zabbix完成Web端配置,使用Admin/zabbix登录。
|
7月前
|
安全 Linux Shell
免费延期一年!Alibaba Cloud Linux 2 EOL 延保支持计划
阿里云决定在 2024 年 03 月 31 日 EOL 的基础上为用户提供免费一年时间的延保服务。
|
7月前
|
安全 Shell Linux
【Shell 命令集合 系统设置 】Linux 初始化系统设置setup命令 使用指南
【Shell 命令集合 系统设置 】Linux 初始化系统设置setup命令 使用指南
90 0
|
5月前
|
弹性计算 运维 Linux
基于在Alibaba Cloud Linux 3 的OS Copilot 产品评测
作为一名技术运维的工作者,每天做的最多一件事就是在Linux下敲各种各样的命令,或完成功能性的部署,或检查系统的稳定性。如果 OS Copilot 作为我的日常工具,我使用场景会更集中于快捷命令或脚本的实现,智能帮我生成各类功能脚本,为我提高运维效率。
基于在Alibaba Cloud Linux 3 的OS Copilot 产品评测
|
5月前
|
存储 Linux
linux /www/server/cron内log文件占用空间过大,/www/server/cron是什么内容,/www/server/cron是否可以删除
linux /www/server/cron内log文件占用空间过大,/www/server/cron是什么内容,/www/server/cron是否可以删除
94 1
|
6月前
|
弹性计算 安全 Cloud Native
Alibaba Cloud Linux镜像系统超好用!兼容CentOS生态,性能稳定性绝对可以!
Alibaba Cloud Linux是阿里云的自研Linux发行版,兼容CentOS/RHEL,提供长期免费支持。它针对云服务器ECS优化,适用于多种场景,如Web服务、云原生应用等。Alibaba Cloud Linux 3基于Anolis OS 8,提供安全、高性能、十年维护及丰富的开源生态。用户可在ECS购买时选择镜像安装,支持多架构并提供热补丁、解决方案和快速启动版。更换ECS操作系统是免费的。
792 5
|
6月前
|
监控 Linux BI
【linux服务器系统盘爆满】/www/server/total/logs/目录内容过多导致服务器系统盘爆满,/www/server/total/logs/ 里是什么内容?是否可以删除?
【linux服务器系统盘爆满】/www/server/total/logs/目录内容过多导致服务器系统盘爆满,/www/server/total/logs/ 里是什么内容?是否可以删除?
130 1
|
6月前
|
人工智能 Linux Python
Alibaba Cloud Linux 3.2104 LTS 64位 怎么安装python3.10.12和pip3.10
Alibaba Cloud Linux 3.2104 LTS 64位 怎么安装python3.10.12和pip3.10
785 0
|
7月前
|
Linux 网络安全
xmanager 4 连接SuSE linux server 11方法
xmanager 4 连接SuSE linux server 11方法
48 1
|
7月前
|
弹性计算 负载均衡 网络协议
LVS (Linux Virtual server)集群介绍
LVS (Linux Virtual server)集群介绍