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
|
|
|
|
[Zulip server development environment](dev-overview.html#requirements) instead.
|
|
|
|
|
|
|
|
You will need an Ubuntu system that satisfies
|
|
|
|
[the installation requirements](prod-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.
|
|
|
|
* Ubuntu 14.04 Trusty or Ubuntu 16.04 Xenial, 64-bit.
|
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.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
|
|
|
## Step 1: Install SSL Certificates
|
|
|
|
|
2017-07-26 00:49:16 +02:00
|
|
|
Zulip runs over `https` only, and requires SSL certificates in order to
|
2016-08-25 04:01:03 +02:00
|
|
|
work. It looks for the certificates in `/etc/ssl/private/zulip.key`
|
|
|
|
and `/etc/ssl/certs/zulip.combined-chain.crt`. Note that Zulip uses
|
|
|
|
`nginx` as its webserver and thus [expects a chained certificate
|
2017-07-26 00:49:16 +02:00
|
|
|
bundle](http://nginx.org/en/docs/http/configuring_https_servers.html).
|
2016-08-25 04:01:03 +02:00
|
|
|
|
2016-08-25 06:33:09 +02:00
|
|
|
If you need an SSL certificate, see [our SSL certificate
|
|
|
|
documentation](ssl-certificates.html). If you already have an SSL
|
2017-07-26 00:49:16 +02:00
|
|
|
certificate, just install (or symlink) it into place at the above
|
2016-08-25 06:33:09 +02:00
|
|
|
paths, and move on to the next step.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2016-08-25 06:36:07 +02:00
|
|
|
## Step 2: Download and install latest release
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2016-08-25 06:36:07 +02:00
|
|
|
If you haven't already, 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
|
|
|
```
|
|
|
|
|
2016-08-25 06:36:07 +02:00
|
|
|
Then, run the Zulip install script:
|
2016-07-28 01:38:02 +02:00
|
|
|
```
|
2017-08-10 02:36:13 +02:00
|
|
|
sudo -s # If not already root
|
|
|
|
./zulip-server-*/scripts/setup/install
|
2016-07-28 01:38:02 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
This may take a while to run, since it will install a large number of
|
2017-08-10 02:36:13 +02:00
|
|
|
dependencies.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2016-08-25 04:01:03 +02:00
|
|
|
The Zulip install script is designed to be idempotent, so if it fails,
|
|
|
|
you can just rerun it after correcting the issue that caused it to
|
|
|
|
fail. Also note that it automatically logs a transcript to
|
|
|
|
`/var/log/zulip/install.log`; please include a copy of that file in
|
|
|
|
any bug reports.
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-08-10 02:36:13 +02:00
|
|
|
The install script does several things:
|
|
|
|
* Creates `zulip` user, which the various Zulip servers will run as,
|
|
|
|
* Creates `/home/zulip/deployments/`, which the Zulip code for this
|
|
|
|
deployment (and future deployments when you upgrade) go into. At the
|
|
|
|
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.
|
|
|
|
* Cconfigures the various third-party services Zulip uses, including
|
|
|
|
Postgres, RabbitMQ, Memcached and Redis.
|
|
|
|
|
2016-08-25 06:36:07 +02:00
|
|
|
## Step 3: Configure Zulip
|
2016-07-28 01:38:02 +02:00
|
|
|
|
|
|
|
Configure the Zulip server instance by editing `/etc/zulip/settings.py` and
|
|
|
|
providing values for the mandatory settings, which are all found under the
|
2017-08-16 01:50:30 +02:00
|
|
|
heading `### MANDATORY SETTINGS`. These settings include:
|
2016-07-28 01:38:02 +02:00
|
|
|
|
2017-02-22 06:15:11 +01:00
|
|
|
- `EXTERNAL_HOST`: the user-accessible Zulip domain name for your
|
2017-07-26 00:49:16 +02:00
|
|
|
Zulip installation (i.e., what users will type in their web
|
2017-02-16 23:03:14 +01:00
|
|
|
browser). This should of course match the DNS name you configured to
|
|
|
|
point to your server and for which you configured SSL certificates.
|
|
|
|
If you plan to use multiple domains, add the others to
|
2017-02-22 06:15:11 +01:00
|
|
|
`ALLOWED_HOSTS`.
|
|
|
|
|
|
|
|
- `ZULIP_ADMINISTRATOR`: the email address of the person or team
|
|
|
|
maintaining this installation and who will get support and error
|
|
|
|
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
|
|
|
|
[our guide for outgoing email](prod-email.html) for help configuring
|
|
|
|
this.
|
2016-08-25 04:01:03 +02:00
|
|
|
|
2017-06-09 05:59:07 +02:00
|
|
|
- If desired, you can also configure additional
|
|
|
|
[authentication backends](prod-authentication-methods.html) while
|
|
|
|
you're editing /etc/zulip/settings.py. Note, however, that the
|
2017-08-16 01:50:30 +02:00
|
|
|
default (email) backend must be enabled when you complete Step 6
|
2017-06-09 05:59:07 +02:00
|
|
|
(creating an organization) below.
|
2017-02-16 23:04:57 +01:00
|
|
|
|
2017-08-16 01:50:30 +02:00
|
|
|
## Step 4: Test email configuration
|
|
|
|
|
|
|
|
If you haven't already,
|
|
|
|
[test your outgoing email configuration](prod-email.html#testing-and-troubleshooting).
|
|
|
|
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
|
|
|
|
commands are run as the `zulip` user using `su zulip`. To initialize
|
|
|
|
the Zulip database for your production install, run:
|
2016-07-28 01:38:02 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
su zulip -c /home/zulip/deployments/current/scripts/setup/initialize-database
|
|
|
|
```
|
|
|
|
|
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
|
|
|
|
command](prod-maintain-secure-upgrade.html#management-commands) :
|
|
|
|
|
|
|
|
```
|
|
|
|
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
|
|
|
|
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
|
2016-10-11 20:04:56 +02: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].
|
|
|
|
* [Learn how further configure your Zulip server](prod-customize.html).
|
|
|
|
* [Learn about maintaining a production Zulip server](prod-maintain-secure-upgrade.html).
|
2016-08-25 06:29:36 +02:00
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
2017-08-16 02:08:20 +02:00
|
|
|
If you get an error after `scripts/setup/install` completes, check the
|
|
|
|
bottom of `/var/log/zulip/errors.log` for a traceback, and consult the
|
2017-02-13 01:55:54 +01:00
|
|
|
[troubleshooting section](prod-troubleshooting.html) for advice on how
|
2017-08-16 02:08:20 +02:00
|
|
|
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-07-26 00:49:16 +02:00
|
|
|
in the [Zulip development community server](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
|