2016-12-07 02:34:41 +01:00
|
|
|
# Production Installation
|
2016-07-12 21:49:44 +02:00
|
|
|
|
2017-07-26 00:49:16 +02:00
|
|
|
Make sure you want to install a Zulip production server. If you'd
|
2016-12-07 02:34:41 +01:00
|
|
|
instead like to test or develop a new feature, we recommend the
|
2017-11-08 17:55:36 +01:00
|
|
|
[Zulip server development environment](../development/overview.html#requirements) instead.
|
2016-12-07 02:34:41 +01:00
|
|
|
|
|
|
|
You will need an Ubuntu system that satisfies
|
2017-11-08 17:55:36 +01:00
|
|
|
[the installation requirements](../production/requirements.html). In short,
|
2017-06-04 08:30:10 +02:00
|
|
|
you need:
|
2017-07-26 00:49:16 +02:00
|
|
|
* Either a dedicated machine, or a fresh VM on an existing machine.
|
2017-10-20 23:33:50 +02:00
|
|
|
* Ubuntu 16.04 Xenial or Ubuntu 14.04 Trusty, 64-bit. If you have a
|
|
|
|
choice, install on Xenial, since Trusty is approaching its
|
|
|
|
end-of-life and you'll save yourself the work of upgrading a
|
|
|
|
production installation.
|
2017-06-04 08:30:10 +02:00
|
|
|
* At least 2GB RAM and 10 GB disk space (4GB and 2 CPUs recommended for 100+ users).
|
|
|
|
* A DNS name, an SSL certificate, and credentials for sending email.
|
2017-10-28 02:46:31 +02:00
|
|
|
For most users, you can just use our handy `--certbot` option to
|
|
|
|
generate the SSL certificate.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-10-28 02:46:31 +02:00
|
|
|
## Step 1: Download the latest release
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-10-18 12:34:56 +02:00
|
|
|
Download and unpack [the latest built server
|
2017-01-29 02:56:25 +01:00
|
|
|
tarball](https://www.zulip.org/dist/releases/zulip-server-latest.tar.gz)
|
2016-08-25 06:36:07 +02:00
|
|
|
with the following commands:
|
2016-07-28 01:38:02 +02:00
|
|
|
|
|
|
|
```
|
2017-08-10 02:36:13 +02:00
|
|
|
cd $(mktemp -d)
|
2017-01-29 02:56:25 +01:00
|
|
|
wget https://www.zulip.org/dist/releases/zulip-server-latest.tar.gz
|
2017-08-10 02:36:13 +02:00
|
|
|
tar -xf zulip-server-latest.tar.gz
|
2016-07-28 01:38:02 +02:00
|
|
|
```
|
|
|
|
|
2017-10-18 07:16:37 +02:00
|
|
|
If you'd like to verify the download, we
|
|
|
|
[publish the sha256sums of our release tarballs](https://www.zulip.org/dist/releases/SHA256SUMS.txt).
|
2017-10-17 09:29:40 +02:00
|
|
|
|
2017-10-28 02:46:31 +02:00
|
|
|
## Step 2: Install Zulip
|
|
|
|
|
2018-01-23 19:52:23 +01:00
|
|
|
```eval_rst
|
|
|
|
.. only:: unreleased
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
You are reading a **development version** of the Zulip documentation.
|
|
|
|
These instructions may not correspond to the latest Zulip Server
|
|
|
|
release. See `documentation for the latest release`__.
|
|
|
|
|
|
|
|
__ https://zulip.readthedocs.io/en/stable/prod-install.html
|
|
|
|
```
|
|
|
|
|
2017-12-13 04:54:10 +01:00
|
|
|
To set up Zulip with the most common configuration, you can run the
|
|
|
|
installer as follows:
|
2017-10-28 02:46:31 +02:00
|
|
|
|
2016-07-28 01:38:02 +02:00
|
|
|
```
|
2017-10-28 02:46:31 +02:00
|
|
|
sudo -i # If not already root
|
|
|
|
./zulip-server-*/scripts/setup/install --certbot \
|
2017-12-13 04:54:10 +01:00
|
|
|
--email=YOUR_EMAIL --hostname=YOUR_HOSTNAME
|
2016-07-28 01:38:02 +02:00
|
|
|
```
|
|
|
|
|
2017-10-28 02:46:31 +02:00
|
|
|
This will take a while to run, since it will install a large number of
|
2017-12-13 04:54:10 +01:00
|
|
|
dependencies from the PyPI and NPM repositories.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-12-13 04:54:10 +01:00
|
|
|
#### Installer options
|
|
|
|
|
|
|
|
* `--email=you@example.com`: The email address of the person or team
|
|
|
|
who should get support and error emails from this Zulip server.
|
|
|
|
This becomes `ZULIP_ADMINISTRATOR` ([docs][doc-settings]) in the
|
|
|
|
Zulip settings.
|
|
|
|
|
|
|
|
* `--hostname=zulip.example.com`: The user-accessible domain name for
|
|
|
|
this Zulip server, i.e., what users will type in their web browser.
|
|
|
|
This becomes `EXTERNAL_HOST` ([docs][doc-settings]) in the Zulip
|
|
|
|
settings.
|
|
|
|
|
2018-01-24 02:54:23 +01:00
|
|
|
* `--self-signed-cert`: With this option, the Zulip installer
|
|
|
|
generates a self-signed SSL certificate for the server. This isn't
|
|
|
|
suitable for production use, but may be convenient for testing.
|
|
|
|
|
2017-12-13 04:54:10 +01:00
|
|
|
* `--certbot`: With this option, the Zulip installer automatically
|
|
|
|
obtains an SSL certificate for the server [using Certbot][doc-certbot].
|
|
|
|
If you'd prefer to acquire an SSL certificate yourself in any other
|
|
|
|
way, it's easy to [provide it to Zulip][doc-ssl-manual].
|
|
|
|
|
|
|
|
[doc-settings]: ../production/customize.html
|
|
|
|
[doc-certbot]: ../production/ssl-certificates.html#certbot-recommended
|
|
|
|
[doc-ssl-manual]: ../production/ssl-certificates.html#manual-install
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-10-28 02:46:31 +02:00
|
|
|
#### What the installer does
|
|
|
|
|
2017-08-10 02:36:13 +02:00
|
|
|
The install script does several things:
|
2017-12-13 04:54:10 +01:00
|
|
|
* Creates the `zulip` user, which the various Zulip servers will run as.
|
2017-08-10 02:36:13 +02:00
|
|
|
* Creates `/home/zulip/deployments/`, which the Zulip code for this
|
2017-12-13 04:54:10 +01:00
|
|
|
deployment (and future deployments when you upgrade) goes into. At the
|
2017-08-10 02:36:13 +02:00
|
|
|
very end of the install process, the script moves the Zulip code tree
|
|
|
|
it's running from (which you unpacked from a tarball above) to a
|
|
|
|
directory there, and makes `/home/zulip/deployments/current` as a
|
|
|
|
symbolic link to it.
|
|
|
|
* Installs Zulip's various dependencies.
|
2017-10-20 23:55:16 +02:00
|
|
|
* Configures the various third-party services Zulip uses, including
|
2017-08-10 02:36:13 +02:00
|
|
|
Postgres, RabbitMQ, Memcached and Redis.
|
|
|
|
|
2017-12-13 04:54:10 +01:00
|
|
|
#### Troubleshooting install failures
|
|
|
|
|
|
|
|
The Zulip install script is designed to be idempotent. This means
|
|
|
|
that if it fails, then once you've corrected the cause of the failure,
|
|
|
|
you can just rerun the script.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-12-13 04:54:10 +01:00
|
|
|
The install script automatically logs a transcript to
|
|
|
|
`/var/log/zulip/install.log`. In case of failure, you might find the
|
|
|
|
log handy for resolving the issue. Please include a copy of this log
|
|
|
|
file in any bug reports.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-10-28 02:46:31 +02:00
|
|
|
## Step 3: Configure outgoing email
|
2017-02-22 06:15:11 +01:00
|
|
|
|
2017-10-28 02:46:31 +02:00
|
|
|
Configure the Zulip server instance by editing
|
|
|
|
`/etc/zulip/settings.py` to enable your server's ability to send
|
|
|
|
outgoing emails:
|
2016-08-25 04:01:03 +02:00
|
|
|
|
2017-08-16 01:50:30 +02:00
|
|
|
- `EMAIL_HOST`, `EMAIL_HOST_USER`: credentials for an outgoing email
|
|
|
|
(aka "SMTP") server that Zulip can use to send emails. See
|
2017-11-08 17:55:36 +01:00
|
|
|
[our guide for outgoing email](email.html) for help configuring
|
2017-08-16 01:50:30 +02:00
|
|
|
this.
|
2016-08-25 04:01:03 +02:00
|
|
|
|
2017-08-16 01:50:30 +02:00
|
|
|
## Step 4: Test email configuration
|
|
|
|
|
2017-11-08 17:55:36 +01:00
|
|
|
[Test your outgoing email configuration](email.html#testing-and-troubleshooting).
|
2017-08-16 01:50:30 +02:00
|
|
|
This is important to test now, because email configuration errors are
|
|
|
|
common, and your outgoing email configuration needs to be working in
|
|
|
|
order for you to complete the installation.
|
|
|
|
|
|
|
|
## Step 5: Initialize Zulip database
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-02-14 22:00:13 +01:00
|
|
|
At this point, you are done doing things as root. The remaining
|
2017-10-20 23:42:12 +02:00
|
|
|
commands are run as the `zulip` user. Change to the `zulip` user
|
|
|
|
and initialize the Zulip database for your production install:
|
2016-07-28 01:38:02 +02:00
|
|
|
|
|
|
|
```
|
2017-10-20 23:42:12 +02:00
|
|
|
su zulip # If you weren't already the zulip user
|
|
|
|
/home/zulip/deployments/current/scripts/setup/initialize-database
|
2016-07-28 01:38:02 +02:00
|
|
|
```
|
|
|
|
|
2016-08-25 04:01:03 +02:00
|
|
|
The `initialize-database` script will report an error if you did not
|
|
|
|
fill in all the mandatory settings from `/etc/zulip/settings.py`. It
|
|
|
|
is safe to rerun it after correcting the problem if that happens.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2016-08-25 06:29:36 +02:00
|
|
|
This completes the process of installing Zulip on your server.
|
|
|
|
However, in order to use Zulip, you'll need to create an organization
|
|
|
|
in your Zulip installation.
|
|
|
|
|
2017-08-16 01:50:30 +02:00
|
|
|
## Step 6: Create a Zulip organization and login
|
2016-08-25 06:29:36 +02:00
|
|
|
|
|
|
|
* Run the organization (realm) creation [management
|
2017-11-08 17:55:36 +01:00
|
|
|
command](../production/maintain-secure-upgrade.html#management-commands) :
|
2016-08-25 06:29:36 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
su zulip # If you weren't already the zulip user
|
2017-02-03 21:46:58 +01:00
|
|
|
/home/zulip/deployments/current/manage.py generate_realm_creation_link
|
2016-08-25 06:29:36 +02:00
|
|
|
```
|
|
|
|
|
2017-07-26 00:49:16 +02:00
|
|
|
This will print out a secure one-time-use link that allows creation of a
|
2017-08-24 04:54:10 +02:00
|
|
|
new Zulip organization on your server.
|
2016-08-25 06:29:36 +02:00
|
|
|
|
2017-07-26 00:49:16 +02:00
|
|
|
* Open the generated link with your web browser. You'll see the "Create
|
2017-11-08 17:55:36 +01:00
|
|
|
organization" page ([screenshot here](../_static/zulip-create-realm.png)).
|
2016-08-25 06:29:36 +02:00
|
|
|
Enter your email address and click *Create organization*.
|
|
|
|
|
|
|
|
* Check your email to find the confirmation email and click the
|
|
|
|
link. You'll be prompted to finish setting up your organization and
|
|
|
|
initial administrator user ([screenshot
|
2017-11-08 17:55:36 +01:00
|
|
|
here](../_static/zulip-create-user-and-org.png)). Complete this form and
|
2016-08-25 06:29:36 +02:00
|
|
|
log in!
|
|
|
|
|
|
|
|
**Congratulations!** You are logged in as an organization
|
2017-08-16 02:05:02 +02:00
|
|
|
administrator for your new Zulip organization.
|
2016-08-25 06:29:36 +02:00
|
|
|
|
2017-08-16 01:50:30 +02:00
|
|
|
## Step 7: Next steps
|
2016-08-25 06:29:36 +02:00
|
|
|
|
2017-08-16 01:25:24 +02:00
|
|
|
* Subscribe to the extremely low-traffic
|
|
|
|
[Zulip announcements email list](https://groups.google.com/forum/#!forum/zulip-announce)
|
|
|
|
to get important announcements for Zulip server administrators about
|
|
|
|
new releases, security issues, etc.
|
|
|
|
* [Follow Zulip on Twitter](https://twitter.com/zulip) to get Zulip news.
|
2017-08-16 02:09:19 +02:00
|
|
|
* [Learn how to setup your new Zulip organization][realm-admin-docs].
|
2017-11-08 17:55:36 +01:00
|
|
|
* [Learn how further configure your Zulip server](customize.html).
|
|
|
|
* [Learn about maintaining a production Zulip server](../production/maintain-secure-upgrade.html).
|
2016-08-25 06:29:36 +02:00
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
2017-10-20 23:51:19 +02:00
|
|
|
* The `zulip` user's password. By default, the `zulip` user doesn't
|
|
|
|
have a password, and is intended to be accessed by `su zulip` from the
|
|
|
|
`root` user (or via SSH keys or a password, if you want to set those
|
|
|
|
up, but that's up to you as the system administrator). Most people
|
|
|
|
who are prompted for a password when running `su zulip` turn out to
|
|
|
|
already have switched to the `zulip` user earlier in their session,
|
|
|
|
and can just skip that step.
|
|
|
|
|
|
|
|
* If you get an error after `scripts/setup/install` completes, check
|
|
|
|
the bottom of `/var/log/zulip/errors.log` for a traceback, and consult
|
2017-11-08 17:55:36 +01:00
|
|
|
the [troubleshooting section](troubleshooting.html) for advice on
|
2017-10-20 23:51:19 +02:00
|
|
|
how to debug.
|
|
|
|
|
|
|
|
* If that doesn't help, please visit
|
2017-02-13 02:04:05 +01:00
|
|
|
[#production help](https://chat.zulip.org/#narrow/stream/production.20help)
|
2017-11-16 20:39:29 +01:00
|
|
|
in the [Zulip development community server](../contributing/chat-zulip-org.html) for
|
2017-02-13 01:55:54 +01:00
|
|
|
realtime help or email zulip-help@googlegroups.com with the full
|
2017-08-16 02:08:20 +02:00
|
|
|
traceback, and we'll try to help you out! Please provide details like
|
|
|
|
the full traceback from the bottom of `/var/log/zulip/errors.log` in
|
|
|
|
your report.
|
2017-06-08 22:28:51 +02:00
|
|
|
|
|
|
|
[realm-admin-docs]: https://zulipchat.com/help/getting-your-organization-started-with-zulip
|