2021-01-21 10:38:57 +01:00
|
|
|
# Advanced setup
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
Contents:
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- [Installing directly on Ubuntu, Debian, CentOS, or Fedora](#installing-directly-on-ubuntu-debian-centos-or-fedora)
|
|
|
|
- [Installing directly on Windows 10 with WSL 2](#installing-directly-on-windows-10-with-wsl-2)
|
|
|
|
- [Using the Vagrant Hyper-V provider on Windows](#using-the-vagrant-hyper-v-provider-on-windows-beta)
|
|
|
|
- [Newer versions of supported platforms](#newer-versions-of-supported-platforms)
|
|
|
|
- [Installing directly on cloud9](#installing-on-cloud9)
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2020-10-23 02:43:28 +02:00
|
|
|
## Installing directly on Ubuntu, Debian, CentOS, or Fedora
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2018-05-30 18:42:03 +02:00
|
|
|
If you'd like to install a Zulip development environment on a computer
|
|
|
|
that's running one of:
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- Ubuntu 20.04 Focal, 18.04 Bionic
|
|
|
|
- Debian 10 Buster, 11 Bullseye (beta)
|
|
|
|
- CentOS 7 (beta)
|
|
|
|
- Fedora 33 and 34 (beta)
|
|
|
|
- RHEL 7 (beta)
|
2018-05-30 18:42:03 +02:00
|
|
|
|
|
|
|
You can just run the Zulip provision script on your machine.
|
|
|
|
|
2021-03-24 15:27:22 +01:00
|
|
|
**Note**: You should not use the `root` user to run the installation.
|
2019-09-30 19:37:56 +02:00
|
|
|
If you are using a [remote server](../development/remote.md), see
|
2018-10-20 05:52:38 +02:00
|
|
|
the
|
2019-04-06 02:58:44 +02:00
|
|
|
[section on creating appropriate user accounts](../development/remote.html#setting-up-user-accounts).
|
2018-10-20 05:52:38 +02:00
|
|
|
|
2021-08-10 07:55:12 +02:00
|
|
|
:::{warning}
|
|
|
|
There is no supported uninstallation process with this
|
|
|
|
method. If you want that, use the Vagrant environment, where you can
|
|
|
|
just do `vagrant destroy` to clean up the development environment.
|
|
|
|
:::
|
2018-05-30 18:42:03 +02:00
|
|
|
|
2018-02-16 11:42:34 +01:00
|
|
|
Start by [cloning your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
|
|
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
2017-10-17 04:13:46 +02:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2020-05-21 22:05:57 +02:00
|
|
|
git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git
|
2018-05-06 11:30:15 +02:00
|
|
|
cd zulip
|
2018-02-16 11:42:34 +01:00
|
|
|
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
|
|
```
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2019-01-04 21:29:52 +01:00
|
|
|
# On CentOS/RHEL, you must first install epel-release, and then python36,
|
2019-01-04 21:29:52 +01:00
|
|
|
# and finally you must run `sudo ln -nsf /usr/bin/python36 /usr/bin/python3`
|
2018-12-18 14:58:52 +01:00
|
|
|
# On Fedora, you must first install python3
|
2016-11-28 02:50:33 +01:00
|
|
|
# From a clone of zulip.git
|
2017-01-14 11:19:26 +01:00
|
|
|
./tools/provision
|
2017-08-09 00:44:40 +02:00
|
|
|
source /srv/zulip-py3-venv/bin/activate
|
2016-11-28 02:50:33 +01:00
|
|
|
./tools/run-dev.py # starts the development server
|
|
|
|
```
|
|
|
|
|
|
|
|
Once you've done the above setup, you can pick up the [documentation
|
|
|
|
on using the Zulip development
|
2019-04-06 02:58:44 +02:00
|
|
|
environment](../development/setup-vagrant.html#step-4-developing),
|
2016-11-28 02:50:33 +01:00
|
|
|
ignoring the parts about `vagrant` (since you're not using it).
|
|
|
|
|
2021-04-14 06:29:13 +02:00
|
|
|
## Installing directly on Windows 10 with WSL 2
|
2020-04-08 07:59:44 +02:00
|
|
|
|
docs: Add missing space to compound verbs “log in”, “set up”, etc.
Noun: backup, checkout, cleanup, login, logout, setup, shutdown, signup,
timeout.
Verb: back up, check out, clean up, log in, log out, set up, shut
down, sign up, time out.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-25 23:05:38 +02:00
|
|
|
Zulip's development environment is most easily set up on Windows using
|
2021-04-14 06:29:13 +02:00
|
|
|
the [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-about)
|
|
|
|
installation method described here.
|
2021-02-17 04:05:52 +01:00
|
|
|
|
2020-04-08 07:59:44 +02:00
|
|
|
1. Install WSL 2 by following the instructions provided by Microsoft
|
|
|
|
[here](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install).
|
|
|
|
|
|
|
|
1. Install the `Ubuntu 18.04` Linux distribution from the Microsoft
|
2021-04-14 06:29:13 +02:00
|
|
|
Store.
|
2020-04-08 07:59:44 +02:00
|
|
|
|
|
|
|
1. Launch the `Ubuntu 18.04` shell and run the following commands:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2020-04-08 07:59:44 +02:00
|
|
|
sudo apt update && sudo apt upgrade
|
|
|
|
sudo apt install rabbitmq-server memcached redis-server postgresql
|
|
|
|
```
|
|
|
|
|
2020-04-18 19:20:38 +02:00
|
|
|
1. Open `/etc/rabbitmq/rabbitmq-env.conf` using e.g.:
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2020-04-18 19:20:38 +02:00
|
|
|
sudo vim /etc/rabbitmq/rabbitmq-env.conf
|
2020-04-08 07:59:44 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Add the following lines at the end of your file and save:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```ini
|
2020-04-08 07:59:44 +02:00
|
|
|
NODE_IP_ADDRESS=127.0.0.1
|
|
|
|
NODE_PORT=5672
|
|
|
|
```
|
|
|
|
|
2020-11-07 06:00:41 +01:00
|
|
|
1. Make sure you are inside the WSL disk and not in a Windows mounted disk.
|
|
|
|
You will run into permission issues if you run `provision` from `zulip`
|
|
|
|
in a Windows mounted disk.
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2020-11-07 06:00:41 +01:00
|
|
|
cd ~ # or cd /home/USERNAME
|
|
|
|
```
|
|
|
|
|
2020-04-08 07:59:44 +02:00
|
|
|
1. [Clone your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
|
|
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2020-05-21 22:05:57 +02:00
|
|
|
git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git ~/zulip
|
|
|
|
cd zulip
|
2020-04-08 07:59:44 +02:00
|
|
|
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
|
|
```
|
|
|
|
|
|
|
|
1. Run the following to install the Zulip development environment and
|
|
|
|
start it (click `Allow access` if you get popups for Windows Firewall
|
|
|
|
blocking some services)
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2020-04-08 07:59:44 +02:00
|
|
|
# Start database, cache, and other services
|
|
|
|
./tools/wsl/start_services
|
|
|
|
# Install/update the Zulip development environment
|
|
|
|
./tools/provision
|
|
|
|
# Enter the Zulip Python environment
|
|
|
|
source /srv/zulip-py3-venv/bin/activate
|
|
|
|
# Start the development server
|
|
|
|
./tools/run-dev.py
|
|
|
|
```
|
|
|
|
|
2021-08-10 07:55:12 +02:00
|
|
|
:::{note}
|
|
|
|
If you shut down WSL, after starting it again, you will have to manually start
|
|
|
|
the services using `./tools/wsl/start_services`.
|
|
|
|
:::
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2020-04-21 07:38:19 +02:00
|
|
|
1. If you are facing problems or you see error messages after running `./tools/run-dev.py`,
|
|
|
|
you can try running `./tools/provision` again.
|
|
|
|
|
|
|
|
1. [Visual Studio Code Remote - WSL](https://code.visualstudio.com/docs/remote/wsl) is
|
|
|
|
recommended for editing files when developing with WSL.
|
|
|
|
|
2020-04-08 07:59:44 +02:00
|
|
|
1. You're done! You can pick up the [documentation on using the
|
|
|
|
Zulip development
|
|
|
|
environment](../development/setup-vagrant.html#step-4-developing),
|
|
|
|
ignoring the parts about `vagrant` (since you're not using it).
|
|
|
|
|
2021-04-14 06:29:13 +02:00
|
|
|
WSL 2 can be uninstalled by following [Microsoft's documentation][uninstall-wsl]
|
|
|
|
|
|
|
|
[uninstall-wsl]: https://docs.microsoft.com/en-us/windows/wsl/faq#how-do-i-uninstall-a-wsl-distribution-
|
|
|
|
|
2021-01-21 10:38:57 +01:00
|
|
|
## Using the Vagrant Hyper-V provider on Windows (beta)
|
|
|
|
|
|
|
|
You should have [Vagrant](https://www.vagrantup.com/downloads) and
|
|
|
|
[Hyper-V][hyper-v] installed on your system. Ensure they both work as
|
|
|
|
expected.
|
|
|
|
|
|
|
|
[hyper-v]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v
|
|
|
|
|
|
|
|
**NOTE**: Hyper-V is available only on Windows Enterprise, Pro, or Education.
|
|
|
|
|
|
|
|
1. Start by [cloning your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
|
|
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2021-01-21 10:38:57 +01:00
|
|
|
git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git
|
|
|
|
cd zulip
|
|
|
|
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
|
|
```
|
|
|
|
|
|
|
|
1. You will have to open up powershell with administrator rights in
|
|
|
|
order to use Hyper-V. Then provision the development environment:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
vagrant up --provider=hyperv
|
|
|
|
```
|
|
|
|
|
|
|
|
You should get output like this:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2021-01-21 10:38:57 +01:00
|
|
|
Bringing machine 'default' up with 'hyperv' provider...
|
|
|
|
==> default: Verifying Hyper-V is enabled...
|
|
|
|
==> default: Verifying Hyper-V is accessible...
|
|
|
|
<other stuff>...
|
|
|
|
==> default: Waiting for the machine to report its IP address...
|
|
|
|
default: Timeout: 120 seconds
|
|
|
|
default: IP: 172.28.119.70
|
|
|
|
==> default: Waiting for machine to boot. This may take a few minutes...
|
|
|
|
default: SSH address: 172.28.122.156
|
|
|
|
==> default: Machine booted and ready!
|
|
|
|
==> default: Preparing SMB shared folders...
|
|
|
|
Vagrant requires administrator access for pruning SMB shares and
|
|
|
|
may request access to complete removal of stale shares.
|
|
|
|
==> default: Starting the machine...
|
|
|
|
<other stuff>...
|
|
|
|
default: Username (user[@domain]): <your-machine-username>
|
|
|
|
default: Password (will be hidden):
|
|
|
|
```
|
|
|
|
|
|
|
|
At this point, you will be prompted for your Windows administrator
|
|
|
|
username and password (not your Microsoft account credentials).
|
|
|
|
|
|
|
|
1. SSH into your newly created virtual machine
|
|
|
|
|
|
|
|
```bash
|
|
|
|
vagrant ssh
|
|
|
|
```
|
|
|
|
|
|
|
|
This will ssh you into the bash shell of the Zulip development environment
|
|
|
|
where you can execute bash commands.
|
|
|
|
|
|
|
|
1. Set the `EXTERNAL_HOST` environment variable.
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2021-01-21 10:38:57 +01:00
|
|
|
(zulip-py3-venv) vagrant@ubuntu-18:/srv/zulip$ export EXTERNAL_HOST="$(hostname -I | xargs):9991"
|
|
|
|
(zulip-py3-venv) vagrant@ubuntu-18:/srv/zulip$ echo $EXTERNAL_HOST
|
|
|
|
```
|
|
|
|
|
|
|
|
The output will be like:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2021-01-21 10:38:57 +01:00
|
|
|
172.28.122.156:9991
|
|
|
|
```
|
|
|
|
|
|
|
|
Make sure you note down this down. This is where your zulip development web
|
|
|
|
server can be accessed.
|
|
|
|
|
2021-08-10 07:55:12 +02:00
|
|
|
:::{important}
|
|
|
|
The output of the above command changes every time you restart the Vagrant
|
|
|
|
development machine. Thus, it will have to be run every time you bring one up.
|
|
|
|
This quirk is one reason this method is marked experimental.
|
|
|
|
:::
|
2021-01-21 10:38:57 +01:00
|
|
|
|
|
|
|
1. You should now be able to start the Zulip development server.
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2021-01-21 10:38:57 +01:00
|
|
|
(zulip-py3-venv) vagrant@ubuntu-18:/srv/zulip$ ./tools/run-dev.py
|
|
|
|
```
|
|
|
|
|
|
|
|
The output will look like:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```console
|
2021-01-21 10:38:57 +01:00
|
|
|
Starting Zulip on:
|
|
|
|
|
|
|
|
http://172.30.24.235:9991/
|
|
|
|
|
|
|
|
Internal ports:
|
|
|
|
9991: Development server proxy (connect here)
|
|
|
|
9992: Django
|
|
|
|
9993: Tornado
|
|
|
|
9994: webpack
|
|
|
|
```
|
|
|
|
|
|
|
|
Visit the indicated URL in your web browser.
|
|
|
|
|
|
|
|
1. You can stop the development environment using `vagrant halt`, and restart it
|
|
|
|
using `vagrant up` and then going through steps **3** and **4** again.
|
|
|
|
|
|
|
|
### Problems you may encounter
|
|
|
|
|
|
|
|
1. If you get the error `Hyper-V could not initialize memory`, this is
|
|
|
|
likely because your system has insufficient free memory to start
|
|
|
|
the virtual machine. You can generally work around this error by
|
2021-09-08 00:23:24 +02:00
|
|
|
closing all other running programs and running
|
|
|
|
`vagrant up --provider=hyperv` again. You can reopen the other
|
|
|
|
programs after the provisioning is completed. If it still isn't
|
|
|
|
enough, try restarting your system and running the command again.
|
2021-01-21 10:38:57 +01:00
|
|
|
|
|
|
|
2. Be patient the first time you run `./tools/run-dev.py`.
|
|
|
|
|
|
|
|
As with other installation methods, please visit [#provision
|
|
|
|
help][provision-help] in the [Zulip development community
|
2021-07-26 07:04:26 +02:00
|
|
|
server](https://zulip.com/developer-community/) if you need help.
|
2021-01-21 10:38:57 +01:00
|
|
|
|
|
|
|
[provision-help]: https://chat.zulip.org/#narrow/stream/21-provision-help
|
|
|
|
|
2021-04-14 06:23:26 +02:00
|
|
|
## Newer versions of supported platforms
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
You can use
|
|
|
|
[our provisioning tool](#installing-directly-on-ubuntu-debian-centos-or-fedora)
|
2020-08-11 01:47:54 +02:00
|
|
|
to set up the Zulip development environment on current versions of
|
2021-02-01 17:58:32 +01:00
|
|
|
these platforms reliably and easily, so we no longer maintain manual
|
2019-03-10 01:23:43 +01:00
|
|
|
installation instructions for these platforms.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
If `tools/provision` doesn't yet support a newer release of Debian or
|
|
|
|
Ubuntu that you're using, we'd love to add support for it. It's
|
|
|
|
likely only a few lines of changes to `tools/lib/provision.py` and
|
|
|
|
`scripts/lib/setup-apt-repo` if you'd like to do it yourself and
|
|
|
|
submit a pull request, or you can ask for help in
|
|
|
|
[#development help](https://chat.zulip.org/#narrow/stream/49-development-help)
|
2021-03-24 15:27:22 +01:00
|
|
|
on chat.zulip.org, and a core team member can help guide you through
|
|
|
|
adding support for the platform.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2020-10-23 02:43:28 +02:00
|
|
|
## Installing on Cloud9
|
2018-02-01 22:58:58 +01:00
|
|
|
|
|
|
|
AWS Cloud9 is a cloud-based integrated development environment (IDE)
|
|
|
|
that lets you write, run, and debug your code with just a browser. It
|
|
|
|
includes a code editor, debugger, and terminal.
|
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
This section documents how to set up the Zulip development environment
|
2020-10-23 02:43:28 +02:00
|
|
|
in a Cloud9 workspace. If you don't have an existing Cloud9 account,
|
2018-02-01 22:58:58 +01:00
|
|
|
you can sign up [here](https://aws.amazon.com/cloud9/).
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- Create a Workspace, and select the blank template.
|
|
|
|
- Resize the workspace to be 1GB of memory and 4GB of disk
|
2018-02-01 22:58:58 +01:00
|
|
|
space. (This is under free limit for both the old Cloud9 and the AWS
|
|
|
|
Free Tier).
|
2021-08-20 21:45:39 +02:00
|
|
|
- Clone the zulip repo:
|
2021-09-08 00:23:24 +02:00
|
|
|
`git clone --config pull.rebase https://github.com/<your-username>/zulip.git`
|
2021-08-20 21:45:39 +02:00
|
|
|
- Restart rabbitmq-server since its broken on Cloud9:
|
2021-09-08 00:23:24 +02:00
|
|
|
`sudo service rabbitmq-server restart`.
|
2021-08-20 21:45:39 +02:00
|
|
|
- And run provision `cd zulip && ./tools/provision`, once this is done.
|
|
|
|
- Activate the Zulip virtual environment by
|
2021-09-08 00:23:24 +02:00
|
|
|
`source /srv/zulip-py3-venv/bin/activate` or by opening a new
|
|
|
|
terminal.
|
2018-02-01 22:58:58 +01:00
|
|
|
|
|
|
|
#### Install zulip-cloud9
|
|
|
|
|
2021-03-24 15:27:22 +01:00
|
|
|
There's a NPM package, `zulip-cloud9`, that provides a wrapper around
|
2018-02-01 22:58:58 +01:00
|
|
|
the Zulip development server for use in the Cloud9 environment.
|
|
|
|
|
|
|
|
Note: `npm i -g zulip-cloud9` does not work in zulip's virtual
|
|
|
|
environment. Although by default, any packages installed in workspace
|
|
|
|
folder (i.e. the top level folder) are added to `$PATH`.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd .. # switch to workspace folder if you are in zulip directory
|
|
|
|
npm i zulip-cloud9
|
|
|
|
zulip-dev start # to start the development server
|
|
|
|
```
|
|
|
|
|
|
|
|
If you get error of the form `bash: cannot find command zulip-dev`,
|
|
|
|
you need to start a new terminal.
|
|
|
|
|
|
|
|
Your development server would be running at
|
|
|
|
`https://<workspace-name>-<username>.c9users.io` on port 8080. You
|
2020-10-23 02:43:28 +02:00
|
|
|
dont need to add `:8080` to your URL, since the Cloud9 proxy should
|
2018-02-01 22:58:58 +01:00
|
|
|
automatically forward the connection. You might want to visit
|
|
|
|
[zulip-cloud9 repo](https://github.com/cPhost/zulip-cloud9) and it's
|
|
|
|
[wiki](https://github.com/cPhost/zulip-cloud9/wiki) for more info on
|
|
|
|
how to use zulip-cloud9 package.
|
|
|
|
|
2019-04-06 02:58:44 +02:00
|
|
|
[zulip-rtd-git-cloning]: ../git/cloning.html#step-1b-clone-to-your-machine
|
|
|
|
[zulip-rtd-git-connect]: ../git/cloning.html#step-1c-connect-your-fork-to-zulip-upstream
|
|
|
|
[port-forward-setup]: ../development/remote.html#running-the-development-server
|