如何在Ubuntu 18.04上使用Cloudron安装Web Apps

The author selected the Wikimedia Foundation to receive a donation as part of the Write for DOnations program.

作者选择Wikimedia Foundation接受捐赠,这是Write for DOnations计划的一部分。

介绍 (Introduction)

Cloudron is a platform that streamlines the installation and management of apps on your server, like WordPress, Rocket.Chat, Nextcloud, GitLab, OpenVPN, and more. A key benefit of using Cloudron is that it performs end-to-end deployment of apps. It automates tasks such as: provisioning databases, DNS setup, certificate management, centralized user management, and automatic backups.

Cloudron是一个可简化服务器上​​应用程序的安装和管理的平台,例如WordPress,Rocket.Chat,Nextcloud,GitLab,OpenVPN等 。 使用Cloudron的主要好处是它可以执行应用程序的端到端部署。 它可以自动执行以下任务:配置数据库,DNS设置,证书管理,集中式用户管理和自动备份。

Apps on Cloudron also receive automatic updates. The Cloudron team tracks upstream app releases and publishes updates for apps. The user experience of installing and updating apps on your server is very similar to how apps are installed and updated on your smartphone: just click to install and start using them without system administration.

Cloudron上的应用程序还会接收自动更新。 Cloudron团队跟踪上游应用程序的发布并发布应用程序的更新。 在服务器上安装和更新应用程序的用户体验与在智能手机上安装和更新应用程序的方式非常相似:只需单击即可安装并开始使用它们,而无需系统管理。

In this tutorial, you’ll install Cloudron on your server then deploy a WordPress site, as an example, to experience how Cloudron performs complete deployment automation. Finally, to ready your Cloudron instance for production use, you will set up Cloudron to back up to DigitalOcean Spaces.

在本教程中,您将在服务器上安装Cloudron,然后以示例方式部署WordPress网站,以体验Cloudron如何执行完整的部署自动化。 最后,要准备好Cloudron实例以供生产使用,您将设置Cloudron备份到DigitalOcean Spaces。

先决条件 (Prerequisites)

To follow this tutorial, you’ll need:

要遵循本教程,您需要:

  • A server running Ubuntu 18.04 with root access and a sudo, non-root account, you can set this up by following this initial server setup guide.

    如果服务器具有运行Ubuntu 18.04的权限,并且具有root用户访问权限和sudo(非root用户)帐户,则可以按照此初始服务器设置指南进行设置

  • A domain name for app installation. If you use a domain like example.com, Cloudron will install its dashboard at my.example.com and the apps will be installed under subdomains that you specify, like git.example.com, chat.example.com, and so on. It is safe to use a domain that is already in use as long as the my subdomain is available.

    应用程序安装的域名。 如果您使用example.com类的域,则Cloudron会将其仪表板安装在my.example.com ,这些应用程序将安装在您指定的子域下,例如git.example.comchat.example.com等。 只要my子域可用,使用已经使用的域是安全的。

  • DNS API keys that Cloudron will use to perform DNS automation. Cloudron supports many DNS providers. If your DNS provider is not supported, you can use the wildcard or manual option. In this tutorial, we will use DigitalOcean DNS. You can generate a DigitalOcean DNS API key following How To Create a Personal Access Token.

    Cloudron将用于执行DNS自动化的DNS API密钥。 Cloudron支持许多DNS提供商 。 如果不支持您的DNS提供程序,则可以使用通配符手动选项。 在本教程中,我们将使用DigitalOcean DNS 。 您可以按照如何创建个人访问令牌生成DigitalOcean DNS API密钥。

  • A DigitalOcean Space with API keys (access and secret). To create a DigitalOcean Space and API keys, see How To Create a DigitalOcean Space and API Key.

    具有API密钥(访问和密钥)的DigitalOcean Space。 要创建DigitalOcean Space和API密钥,请参阅如何创建DigitalOcean Space和API密钥

第1步-安装Cloudron (Step 1 — Installing Cloudron)

To begin, you’ll install Cloudron to your server using the official installation script. If you wish to skip this setup step, you can use the Cloudron 1-click image in the DigitalOcean Marketplace. Otherwise, for installing Cloudron manually, continue with this step.

首先,您将使用官方安装脚本将Cloudron安装到服务器上。 如果您希望跳过此设置步骤,则可以在DigitalOcean Marketplace中使用Cloudron一键式图像。 否则,要手动安装Cloudron,请继续此步骤。

First, as your non-root user, download the setup script by running the following command:

首先,以您的非root用户身份,通过运行以下命令来下载安装脚本:

  • wget https://cloudron.io/cloudron-setup

    wget https://cloudron.io/cloudron-setup

Next, to make the setup script executable, run the following the command:

接下来,要使安装脚本可执行,请运行以下命令:

  • chmod +x ./cloudron-setup

    chmod + x ./cloudron设置

Finally, to install Cloudron, run the following command:

最后,要安装Cloudron,请运行以下命令:

  • sudo ./cloudron-setup --provider digitalocean

    sudo ./cloudron-setup --provider digitalocean

The setup will take around 10 minutes. Once setup is complete, the script will ask your permission to reboot the server, select Y to continue:

设置大约需要10分钟。 设置完成后,脚本将询问您是否允许重新启动服务器,请选择Y继续:


   
   
Output
############################################## Cloudron Setup (latest) ############################################## Follow setup logs in a second terminal with: $ tail -f /var/log/cloudron-setup.log Join us at https://forum.cloudron.io for any questions. => Installing software-properties-common => Ensure required apt sources => Updating apt and installing script dependencies => Checking version => Downloading version 3.5.0 ... => Installing base dependencies and downloading docker images (this takes some time) ... => Installing version 3.5.0 (this takes some time) ... => Waiting for cloudron to be ready (this takes some time) .... Visit https://<IP> and accept the self-signed certificate to finish setup. The server has to be rebooted to apply all the settings. Reboot now ? [Y/n] Y

You’ve installed Cloudron on your server, now you can set up your domain and administrator account.

您已经在服务器上安装了Cloudron,现在可以设置域和管理员帐户。

第2步-设置Cloudron (Step 2 — Setting Up Cloudron)

In this step, you’ll configure Cloudron’s primary domain using the setup wizard and set up your Cloudron account for access. You’ll also provide Cloudron with your DigitalOcean API keys to secure your domain with Let’s Encrypt.

在此步骤中,您将使用设置向导配置Cloudron的主域,并设置您的Cloudron帐户以进行访问。 您还将为Cloudron提供DigitalOcean API密钥,以通过Let's Encrypt保护您的域。

Once the server has rebooted, navigate to https://your-server-ip in your browser and accept the self-signed certificate.

服务器重新启动后,在浏览器中导航至https:// your-server-ip并接受自签名证书。

In Chrome, you can accept the self-signed certificate by clicking on Advanced and then click Proceed to your-server-ip (unsafe). In Firefox, click on Advanced, then Add Exception, and finally Confirm Security Exception.

在Chrome中,您可以通过单击高级 ,然后单击继续至您的服务器IP (不安全)来接受自签名证书。 在Firefox中,点击高级 ,然后点击添加例外 ,最后确认安全例外

At this point, the Cloudron setup wizard will appear. Provide a domain name and select where you host your domain. Although Cloudron supports many DNS providers, like Cloudflare, Gandi, and GoDaddy, in this tutorial, the examples will follow with the domain using DigitalOcean as the DNS provider.

此时,将显示Cloudron设置向导。 提供一个域名,然后选择您托管域的位置。 尽管Cloudron支持许多DNS提供程序 ,例如Cloudflare,Gandi和GoDaddy,但是在本教程中,示例将与使用DigitalOcean作为DNS提供程序的域一起使用。

Provide your DigitalOcean API token and click Next.

提供您的DigitalOcean API令牌 ,然后单击“ 下一步”

Cloudron will use these keys to configure the DNS and obtain Let’s Encrypt certificates for your domain. Cloudron will redirect to https://my.example.com. The browser address bar will show a green lock to indicate that the connection to your Cloudron installation is now secure. Complete the setup by providing a username and password.

Cloudron将使用这些密钥来配置DNS并为您的域获取“让我们加密”证书。 Cloudron将重定向到https://my.example.com 。 浏览器地址栏将显示绿色锁,以指示到Cloudron安装的连接现在已安全。 通过提供用户名和密码来完成设置。

Once you have setup an Administrator account, you’ll see the No apps installed yet! screen. You’ve finished setting up your Cloudron account. Next you can decide which apps to install.

设置管理员帐户后,您会看到尚未安装任何应用程序! 屏幕。 您已完成设置Cloudron帐户。 接下来,您可以决定要安装哪些应用。

第3步-安装您的应用 (Step 3 — Installing Your Apps)

You’re now ready to start installing apps.

您现在准备开始安装应用程序。

When you click on App Store on the interface, Cloudron will prompt you to create a cloudron.io account. You’ll use this account to manage your subscription and billing. Cloudron is free to use for two apps.

当您单击界面上的App Store时,Cloudron会提示您创建一个cloudron.io帐户。 您将使用此帐户来管理您的订阅和账单。 Cloudron可免费用于两个应用程序。

Once you sign up, you can install over 50 apps with a single click. Clicking on an app will bring up the installation dialog. As an example, you can click on the WordPress icon and use the blog subdomain. Once you click Install, Cloudron automatically sets up everything necessary for each app, such as: DNS, databases, certificates, and so on.

注册后,只需单击即可安装50多个应用程序。 单击一个应用程序将弹出安装对话框。 例如,您可以单击WordPress图标并使用blog子域。 单击“ 安装”后 ,Cloudron会自动设置每个应用程序所需的所有内容,例如:DNS,数据库,证书等。

When installing an app, you can choose whether the app should integrate with Cloudron’s centralized User management. If you opt to use Cloudron User management, you can log in to the app with your Cloudron username and password. You can then add more users and groups on Cloudron and control if they have access to the app. If you opt to instead leave user management to the app, the app will be pre-setup with an admin account and its credentials will display after installation. You can add more users inside the app itself. Note that apps on Cloudron are always accessible externally—the access control setting only determines how login authentication is done.

安装应用程序时,您可以选择该应用程序是否应与Cloudron的集中式用户管理集成。 如果您选择使用Cloudron用户管理,则可以使用Cloudron用户名和密码登录到该应用程序。 然后,您可以在Cloudron上添加更多用户和组,并控制他们是否有权访问该应用程序。 如果您选择将用户管理留给该应用程序,则该应用程序将使用管理员帐户进行预设置,并且其凭据将在安装后显示。 您可以在应用本身中添加更多用户。 请注意,始终可以从外部访问Cloudron上的应用程序-访问控制设置仅确定登录身份验证的完成方式。

Once installed, you can access the app at https://blog.example.com.

安装后,您可以通过https://blog.example.com访问该应用程序。

You’ve installed an app to your Cloudron instance; you can use this process to install any of the available apps. To protect your data, you’ll configure backups in the next step.

您已经在Cloudron实例上安装了一个应用程序; 您可以使用此过程来安装任何可用的应用程序。 为了保护您的数据,您将在下一步中配置备份。

第4步-配置备份 (Step 4 — Configuring Backups)

Before using Cloudron in a production environment, it is essential to configure Cloudron to periodically save backups to a location that is external to the server. Unlike server snapshots, Cloudron creates backups individually for each app. The primary advantage of this approach is that apps can be individually rolled back, cloned, and even migrated to another new Cloudron installation.

在生产环境中使用Cloudron之前,必须配置Cloudron定期将备份保存到服务器外部的位置。 与服务器快照不同,Cloudron为每个应用程序分别创建备份。 这种方法的主要优点是可以单独回滚,克隆甚至迁移应用到另一个新的Cloudron安装中。

Cloudron can back up to any provider that supports S3 API or any external volume. In this tutorial, you will use DigitalOcean Spaces as the backup storage.

Cloudron可以备份到支持S3 API或任何外部卷的任何提供程序。 在本教程中,您将使用DigitalOcean Spaces作为备份存储。

With your DigitalOcean Space set up, you can use the associated API keys following this guide. Then, configure Cloudron backups by going to the Backups view and clicking Configure.

设置DigitalOcean Space后,您可以按照本指南使用相关的API密钥。 然后,通过转到“ 备份”视图并单击“ 配置”来配置Cloudron备份。

Cloudron will periodically store backups. If your server crashes or you want to move the server to a different DigitalOcean region, you can create a new Droplet, install Cloudron, and restore your server to the exact state from your backup.

Cloudron将定期存储备份。 如果服务器崩溃或要将服务器移至其他DigitalOcean区域,则可以创建一个新的Droplet,安装Cloudron,然后服务器从备份还原到准确的状态。

You’ve connected your Cloudron installation to your DigitalOcean Space and have configured backups. The next reviews some of the other features available with Cloudron.

您已将Cloudron安装连接到DigitalOcean Space并已配置备份。 接下来的内容将介绍Cloudron可用的其他一些功能。

步骤5 —探索其他功能(可选) (Step 5 — Exploring Other Features (Optional))

Cloudron has centralized user management that allows you to invite team members and set up access control for each user.

Cloudron具有集中式用户管理,可让您邀请团队成员并为每个用户设置访问控制。

To add a new member, go to the Users view and click on New User. Cloudron will send the new user an email with a sign-up link.

要添加新成员,请转到“ 用户”视图,然后单击“ 新用户” 。 Cloudron将向新用户发送一封包含注册链接的电子邮件。

A new user can sign up and start using any applications to which you’ve given them access. For the WordPress example in this tutorial, a new user could immediately access it since you installed the application with the User Management option set to Allow all users on this Cloudron.

新用户可以注册并开始使用您有权访问的任何应用程序。 对于本教程中的WordPress示例,由于您安装了“用户管理”选项设置为“ 允许该Cloudron上的所有用户”的应用程序,因此新用户可以立即访问它。

Another common task when managing your Cloudron instance, is installing apps on a domain other than the primary domain. To add a domain, go to the Domains view and click Add Domain. Once completed, you can install apps under this newly added domain.

管理Cloudron实例时,另一个常见任务是在主域以外的域上安装应用程序。 要添加域,请转到“ 域”视图,然后单击“ 添加域” 。 完成后,您可以在此新添加的域下安装应用程序。

Security is always paramount and Cloudron provides turnkey security that includes tracking the details of your Cloudron installation. You can look in the Activity view to see all events logged for your Cloudron as well as all configuration changes.

安全永远是最重要的,Cloudron提供了交钥匙安全性 ,其中包括跟踪Cloudron安装的详细信息。 您可以在“ 活动”视图中查看以查看为Cloudron记录的所有事件以及所有配置更改。

结论 (Conclusion)

In this tutorial, you installed Cloudron on your server. You then installed the WordPress app without having to manually provision databases, configure DNS, set up certificates, and so on. This WordPress installation will get automatic updates for new releases of WordPress. You configured Cloudron to periodically save backups to DigitalOcean Spaces. Finally, you explored other features that can provide additional protection and features to your Cloudron.

在本教程中,您在服务器上安装了Cloudron。 然后,您安装了WordPress应用程序,而无需手动设置数据库,配置DNS,设置证书等。 此WordPress安装将自动获得WordPress新版本的更新。 您已将Cloudron配置为定期将备份保存到DigitalOcean Spaces。 最后,您探索了可以为Cloudron提供额外保护和功能的其他功能。

Manually installing apps on a server is an involved process that has more potential for errors and can be time consuming. Modern web applications use a variety of databases, frameworks, and package managers that can complicate the installation. Furthermore, securing and backing up your applications is a separate process. When manually installing apps to keep them up-to-date, it is necessary to diligently track upstream releases and then apply the updates. Cloudron is a solution that helps you easily deploy and maintain apps on your server.

在服务器上手动安装应用程序是一个涉及到的过程,该过程更有可能出现错误,并且很耗时。 现代Web应用程序使用各种数据库,框架和程序包管理器,这会使安装复杂化。 此外,保护和备份应用程序是一个单独的过程。 在手动安装应用程序以使其保持最新状态时,必须认真跟踪上游发行版,然后应用更新。 Cloudron是可帮助您轻松在服务器上部署和维护应用程序的解决方案。

To learn some more about Cloudron features, you can consult the documentation pages.

要了解有关Cloudron功能的更多信息,可以查阅文档页面

For questions and discussion, visit the forum.

如有疑问和讨论,请访问论坛

翻译自: https://www.digitalocean.com/community/tutorials/how-to-install-web-apps-using-cloudron-on-ubuntu-18-04

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值