CentOS 与 Ubuntu：哪个更适合做服务器？
服务器 Server
![](/data/attachment/album/201701/23/171740pnvolznzx0g00si0.jpg)


已经决定买一台虚拟服务器，但还不能决定使用哪个 Linux 发行版？我们都经历过这种困扰。对于 Linux 发行版来说，要在这么多的发行版和种种<ruby> 支派 <rp>  （ </rp> <rt>  flavors </rt> <rp>  ） </rp></ruby>中选择一个，那简直能让人崩溃。不过，对于服务器而言，有两个主流的 Linux 发行版，那就是 CentOS 和 Ubuntu。但如何从这两个之中选择，这是摆在管理员、初学者和专业人士面前的主要问题。在对这两个（和更多）发行版有了一定的经验之后，我们决定对这两个发行版用于服务器时做个比较。


**利益相关：本文译自 thishosting.rocks，根据国内情况替换了相应推荐的云服务商的链接，有需求者可点击。**


### 概览




|  CentOS |  Ubuntu |
| --- | --- |
| 基于 Red Hat Linux Enterprise | 基于 Debian |
| 更新频度较少 | 经常更新 |
| 更稳定和更安全一些，因为不经常更新。 | 更新的软件包可能不稳定，不安全？不会，因为他们在发布到正式版本前进行了大量测试。 |
| 没有足够的教程和用户群较少（LCTT 译注：可能是由于国内外情况不同，在国内，相对 Ubuntu 来说，人们更喜欢用 CentOS 做服务器） | 丰富的文档，活跃的社区和大量的在线教程 |
| 对初学者困难，因为基于 Red Hat 桌面发行版不流行 | 更容易为已经熟悉桌面版 Ubuntu 的初学者使用 |
| 支持 cPanel | 不支持 cPanel |
| .rpm 软件包和 “yum” 软件包管理器 | .deb 软件包和 “apt-get” 软件包管理器 |
| 在[阿里云](http://click.aliyun.com/m/9419/)和 [Ucloud](https://ucloud.cn/site/free.html) 免费试用 CentOS 服务器 | 在[阿里云](http://click.aliyun.com/m/9419/)和 [Ucloud](https://ucloud.cn/site/free.html) 免费试用 Ubuntu 服务器 |


### 哪个更适合新手？


Ubuntu。


一如往常那样，它主要取决于你的需求和以前的经验，但一般来说，Ubuntu 对于初学者来说是更好的选择。主要是因为这两个原因：


* Ubuntu 有一个庞大的社区，随时可以免费提供帮助。我指的是真正的大。数以千计的用户分布在数百个不同的在线论坛和兴趣组内。甚至有现实生活中的大会。你也可以为 CentOS 找到很多教程和帮助，特别是对于简单的 LAMP 栈和流行的应用程序而言。
* Ubuntu 服务器对于以前使用过 Ubuntu 桌面的人来说会容易得多。同样的情况也存在于 CentOS 和 Fedora 之间，但是 Ubuntu 桌面版比任何其他基于 Linux 的家用桌面更受欢迎。


所以，如果你是一个初学者，而且没有任何特殊要求，那就去使用 Ubuntu 服务器。 更好的是，你可以从一个[便宜的托管服务提供商](https://ucloud.cn/site/free.html)那购买服务，这样你就可以在你的服务器上进行实验，还有一个[专业的 24/7 支持团队](https://ucloud.cn/site/free.html)准备好帮助你。


### 哪个更适合商用？


CentOS。


同样，你仍然可以使用 Ubuntu 作为商用网站或公司内部服务器，但 CentOS 有它的优势：


* CentOS（可以说）更稳定以及更安全。由于 CentOS 的更新频率较低，这意味着软件测试的时间更长，并且只有真正稳定的版本才会得到发布。如果你使用 CentOS，你不会因新的有 bug 的应用程序版本而遇到任何稳定性问题，因为你不会得到那个新的有 bug 的版本。
* 大多数控制面板（包括最受欢迎的控制面板 - cPanel）仅支持 CentOS。所以这意味着如果你是一个网站托管公司，或者如果你是一个有很多客户的网站服务代理商，并且需要一个控制面板 - CentOS 是一个更好的选择。


### 尝试一下它们并选择一个


如果你还是不能决定，你可以免费试试它们。你可以在本地安装或使用 live 镜像。你还可以从[阿里云](http://click.aliyun.com/m/7604/)和 [Ucloud](https://ucloud.cn/site/free.html) 这样的地方买到便宜的虚拟专用服务器。你可以在几秒钟内启动 CentOS/Ubuntu 服务器。


### 哪个更快？


它们在速度方面是相同的。它们和运行在你自己的硬件上一样快。它们将如你配置的一样快。不管怎样，你都应该正确配置并且保护所有的服务器、配置和应用程序。


你会使用哪个发行版？想告诉我们你是哪个发行版的拥趸么？请随时留下评论。




---


**文末评论**


W. Anderson：



> 
> 我的大多数 Linux 服务器部署都是针对企业客户的，所以我对文章作者以 GUI 客户端版本来反映任何服务器的管理功能感到困惑。通常，许多服务提供商也会在 CentOS、Ubuntu，或经常部署的 OpenSuse Leap 和 FreeBSD 10+ 服务器操作系统上提供 WebMin、VirtualAdmin 或类似工具作为控制面板，即使是在虚拟专用服务器（VPS）环境中。
> 
> 
> CentOS 在许多商业应用以及高级网络/虚拟化和云计算环境方面具有明显优于 Ubuntu 的优势，并且 CentOS 充分利用 SELinux 框架用于加强的安全层，而目前在 Ubuntu 中则不可用（或不容易）。
> 
> 
> 这种类型的比较通常是多余的，因为几乎总是有特定的和细微的要求，和需要服务器实现的需求，这将决定哪个发行版具有更多的优势或用途 - 基于技术专家/托管公司的专业知识和广泛的经验。
> 
> 
> 


VAN DER BEKEN：



> 
> 正确的比较应该是对 Debian 和 CentOS 进行比较。
> 
> 
> 以我的经验，我使用 CentOS 和 Debian 作为服务器，稍微偏爱 Debian 一点点，因为它的社区。
> 
> 
> 




---


via: <https://thishosting.rocks/centos-vs-ubuntu-server/>


作者：[thishosting.rocks](https://thishosting.rocks/) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Finally decided to get a VPS but can’t decide which Linux distro to use? We’ve all been there. [ The choice](https://thishosting.rocks/how-to-choose-web-hosting/) may even be overwhelming, even for Linux distros, considering all the different flavors and distros that are out there. Though, the two most widely used and most popular server distros are

**CentOS and Ubuntu**. This is the main dilemma among admins, both beginners and professionals. Having experience with both (and more) distros, we decided to do a comparison of CentOS and Ubuntu when used for a server.


## A quick overview:

![]() CentOS | ![]() Ubuntu |
---|---|

Based on Red Hat Linux Enterprise | Based on Debian |

Less frequently updated | Frequently updated |

Arguably more stable and secure because of the infrequent updates. | Updated packages may be unstable and not secure, which is unlikely since they are vigorously tested before pushed to official release. |

Not enough tutorials and has a smaller userbase | Rich documentation, active community and lots of tutorials available online |

Difficult for beginners, as there are no popular and widely used Red Hat-based Desktop distros | Easier to use for beginners that are already familiar with the Desktop version of Ubuntu |

Supports cPanel | Doesn't support cPanel |

.rpm packages and 'yum' package manager | .deb packages and 'apt-get' package manager |

Try a CentOS server for
|


[free](https://thishosting.rocks/vultr-coupons-for-2017-free-credits-and-more/)at[Vultr](https://thishosting.rocks/go/vultr/)## Which one is better for beginners?

Ubuntu. As always, it highly depends on your requirements and previous experiences, but generally, Ubuntu is a better choice for beginners. Mainly because of these 2 reasons:

- Ubuntu has a
**big**community that’s ready to help for free. And we really do mean big. Thousands of users in hundreds of different online forums and groups. Even real life conventions. You can still find a lot of tutorials and help for CentOS too, especially for simple LAMP stacks and popular applications. - Ubuntu server would be a lot easier for someone that has previously used Ubuntu desktop. The same goes for CentOS and Fedora too, but the Ubuntu Desktop version is far more popular than any other Linux-based distro for home-use.

So, if you are a beginner and don’t have any special requirements, go with an Ubuntu server. Even better if you get a server from a [cheap managed provider](https://thishosting.rocks/best-cheap-managed-vps/), so you can experiment on your server and have a [professional 24/7 support team](https://thishosting.rocks/support/) ready to help you.

## Which one is better for businesses?

CentOS. And again, you can still use Ubuntu for a business website or an internal company server, but CentOS has its advantages:

- CentOS is (arguably) more stable and secure. Since CentOS has less frequent updates, that means that the software is tested for a longer period of time and only truly stable versions get released. You won’t get any stability issues from a new, buggy release of an app if you use CentOS because you won’t actually get that new, buggy release.
- Most control panels (including the most popular one – cPanel) support CentOS only. So that means if you are a web hosting company, or if you are a web agency with a lot of clients and need a control panel – CentOS is a better option.

## Try them out and just pick one

If you still can’t decide, you can just try them out for free. You can install them locally or use a live image. You can also get a cheap VPS ($5/mo) from [Linode](https://thishosting.rocks/go/linode/) and [Vultr](https://thishosting.rocks/go/vultr/). You can spin up a CentOS/Ubuntu server in seconds. When you sign up through an affiliate link (like ours) you’ll probably get free credits – meaning you’ll actually get to try them out for free.

## Which one is faster?

They are the same in terms of speed. They are as fast as your hardware. They’ll be as fast as you configure them. You should properly configure and secure all your servers, configurations and applications, no matter what.





Which distro do you use? Wanna tell us how we are a bunch of [insert distro here] fanboys? Feel free to leave a comment below.

## 24 thoughts on “CentOS vs Ubuntu: Which one is better for a server”

Most all of my Linux server deployments are for business clients, so I am bewildered by article author in referencing GUI Client version in regard any Server admin capability or functions. Often WebMin, VirtualAdmin or similar tools are used as control panels on CentOS, Ubuntu, or frequently deployed OpenSuse Leap and FreeBSD 10+ Server OS by many services providers, even in a Virtual Private Server (VPN) environment.

Centos has distinct advantage over Ubuntu for many business applications, as well as advanced Networking/Virtualization and Cloud Computing environments, and CentOS makes excellent use of SELinux framework for hardened security layer, not currently available (or easily) in Ubuntu.

This type comparison is generally superfluous, since there almost are always specific and nuanced requirements and needs for Server implementation that will dictate which distribution has more advantage or purpose – based on technologists/hosting company’s expertise and broad experience with that distribution.

The right comparison is to be made between Debian and CentOS.

From my experience, I use both CentOS and Debian as servers. I prefer a bit Debian for its community.

There are many Fedora-family distros for home desktop usage.

My RHEL-compatible home systems run Korora.

IMHO ironically Debian feels more r00ted to the original Linux terms of endearment in having a wider, open community of support. Centos, despite the free moniker appears to be Red Hat without the big dollar support model but alas no realistic discerning open community support. With Ubuntu now with free LTS I personally feel Debian will grow and become a major player not just in the home but also business sector and quite rightly so. Microsoft’s inclusion of Ubuntu with Windows 10 is a nod to its uptake.

I am a beginner and I can say because of your write up and the comment you left in the Digital Ocean community, I am going for CENTOS at least for this moment. Once I am good at it, I can transfer my property back to Ubuntu because I am not really good at configuring the server and all those stuffs yet.

Thanks for your work brother

Olawale Daniel

In case I want a stable business server, but my need require a small number of newer software than can be found in CentOS repos, thus going to compiling from source, maybe discovering along the way that some of the dependencies require compilation from source as well etc. – while on Ubuntu I wouldn’t need all that.

Would it be true to say that now my CentOS’ stability&security might be compromised and made worse than Ubuntu’s? I know the case is specific, but that’s a concern I have

With CIA (Confidentiality, Integrity & Availability in mind);

That would be an appropriate acknowledgement, as the availability of various components is restricted by default.

As for stability, I don’t expect it will be significant, though I would generally suggest that stability is a user-experience metric, and as that is tarnished, somewhat in the CentOS example provided, I would acknowledge that Ubuntu has a tiny edge with this as well.

Note, that I have utilized both CentOS, and Ubuntu for production environments, and prefer Ubuntu largely because of its more easily accessible support channels.

Yes i understood difference but for hadoop framwork which on is better centos7 or ubuntu

It all depends on your needs and personal preferences. Follow our comparison, and if you still can’t decide for one, use CentOS for Hadoop.

I don’t know why you think CentOS is more stable. Packages don’t get into the stable repositories for Debian or Ubuntu until they’ve been testing for over a year.

If you want paid support for a RH distro, you get RHEL7, and probably not CentOS. If you want paid support for a Debian distro, you get Ubuntu, which is supported directly by Canonical. However, I can’t imagine a shop with senior sysadmins actually using this service. I never heard of it. If you have senior sysadmins, they already know how to figure out everything.

The one advantage RH/CentOS have over Debian/Ubuntu is that they support their distros for 10 years, versus “5 plus” for Debian/Ubuntu. I don’t see any advantage in running a 10-year-old Linux OS on a workstation OR a server, so I don’t care. Upgrading from one Ubuntu LTS to the next in line is simple and usually works. If it doesn’t, you have backups. If you used Chef or some other CM system, then getting your server completely restored – all packages installed, configs edited, etc. – is a matter of typing a few lines. The more people adopt CM, the more support for a 10-year-old OS will seem like a fish with a bicycle.

That is an inaccurate statement. Ubuntu releases every 6 months. The biggest issue with Ubuntu is the system requirements. It’s requirements are much worse than Microsoft.

This simply is not true. I run Ubuntu Server on an HP XW8600, which is probably circa 2003.

noob. windows is heavier !

Debian/Ubuntu is clearly the better choice (huge market share) in europe, but Centos in the US. RHEL is not popular in europe at all. Even SUSE is more popular.

Ubuntu has about twice the system requirements as Cent OS and is much slower when ran in a server environment just as it is in a home use environment.. Ubuntu is much easier to get support for, but if you need reliability, stability, and the normal things you want from a server then Cent OS is a far better choice.

Ubuntu has twice requirements than Centos? You mean Ubuntu Desktop ? 🙂

Ubuntu LTS has no gui, so requirements are the same than Centos Minimal no gui.

There are other difference such as default filesystem choice(centos XFS, Ubuntu ext4), for some applications could result in really different performance; So Centos make more sense if XFS is needed.

Sincerely, is really difficult saying wich distribution is more stable, both are stable in terms of ABI requirements. Ubuntu has lot of kernel updates(because of desktop use), but is the use case the key of choice:

if you need to use Cpanel, go for Centos. If you need environment for Ruby on Rails, go for Ubuntu.

My Two Cents

Man, you most of you don’t understand that stability means. When you work in a real enterprise environment. I am talking like GE, Coca-Cola. You will realize how much you need a stable Linux. I am sorry but UbuntuLTS is far less stable than you think. We have clusters of 1000’s of servers and the ones that segfault more(often for no reason at all) were UbuntuLTS. That is the reason we replaced them with RHEL Linux. Now there is nothing wrong with Ubuntu at all but for critical applications, I will not trust anything but CENT/RHEL. And before you reply oh you don’t know what you are doing blah blah blah. Trust me I do and so does our team. Facts are Facts. I also don’t need “well I been running it for years blah blah blah”. Just because it doesn’t happen to you doesn’t mean it doesn’t happen. When you have 1000’s of servers and you see a pattern you know for a fact one is better than the other.

I happen to work with both of those clients, and I can tell you it is a mix of Redhat and SUSE, with SUSE on the most critical. Anon on this one just because.. Every single server is under enterprise support despite having top of the line admins on them.

Bah. It’s 2018 and we’re still complaining about the “minimum” system requirements. RAMs nowadays are very cheap, HDDs are even cheaper and larger. The kernel is now Version 4.x with more support for hardware than ever. There’s also a Spectre and Meltdown issue that is being addressed in the Kernel. Common sense will tell us that the distro with an active community and dependable release cycle will have to be the choice.

You already mentioned that its much easier to get support for Ubuntu, then why put your balls in the grill pan with CentOS? 😀 It’s cheaper to upgrade hardware than to put your business at risk because there’s not enough community to get help from.

Dude, who uses Linux as desktop? The discussion about linux are always considering SERVERS!

Please, take off ur arguments.

The form of the documentation is another difference which is rarely mentioned when comparing CentOS/RHEL and Ubuntu. Red Hat’s documentation (most of Red Hat’s manual are available without a subscription and I have found compatable with CentOS) is formal professional written technical manual, a more traditional approach to documentation. Ubuntu relies heavily on wikis. I believe the choice is up to the user what form they feel more comfortable using. I moved to CentOS after using Fedora/OpenSUSE I spend a lot less time fixing updates and I have been a lot more productive using CentOS as a virtual KVM server. Even with the old 3.10 kernel and the older version of qemu it outperforms Fedora. I have not had much success with Ubuntu I find it more difficult than CentOS. download and install both. A few years ago I installed, OpenSuSE, SLED, CentOS, RHEL, Fedora, Debian, and Ubuntu. I choose Fedora and CentOS. They just felt right.

CentOS are much more easier for beginners compare to Ubuntu. Ubuntu customize and tweaked too much it way to make it easier for people to use, however it become a chaos when your trying to manage it. CentOS is a clone of RHEL, everything is more towards for enterprise and have a clear standard for as long as your follows the rules from RHEL.

It’d be better comparing cent with debian.

I’ve been using linux since 2006.

I prefer CentOS for the Long Term Support, and because of this, I’ve had almost no issues that affects the servers. More often than not, its the hardware that reaches Maximum Time Before Failure. I guess its how reliable your servers are that matters, based on my career.

I do appreciate support when I have small hiccups, and yes, I do find them from the CentOS community. And not only that, having been in this biz, you also get support from ALL other Linux Communities, such as Debian based distributions, as well as sub distro’s like Ubuntu. In short, I have never been truly alone.

One thing I tell newbies is that they’re success in this career is largely dependent on their ability to Google problems, and think of a solution out of the box. True developers never are limited by what OS, development platform, or language.