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)
|
2022-08-18 22:58:47 +02:00
|
|
|
- [Installing using Vagrant with VirtualBox on Windows 10](#installing-using-vagrant-with-virtualbox-on-windows-10)
|
2021-08-20 21:45:39 +02:00
|
|
|
- [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)
|
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
|
|
|
|
2023-04-27 20:28:17 +02:00
|
|
|
:::{warning}
|
|
|
|
There is no supported uninstallation process with the direct-install
|
|
|
|
method. If you want that, use [the Vagrant environment](setup-recommended.md),
|
|
|
|
where you can just do `vagrant destroy` to clean up the development environment.
|
|
|
|
:::
|
|
|
|
|
2022-11-23 00:53:46 +01:00
|
|
|
One can install the Zulip development environment directly on a Linux
|
|
|
|
host by following these instructions. Currently supported platforms
|
|
|
|
are:
|
2018-05-30 18:42:03 +02:00
|
|
|
|
2024-03-25 22:31:39 +01:00
|
|
|
- Ubuntu 22.04, 24.04
|
|
|
|
- Debian 12
|
2021-08-20 21:45:39 +02:00
|
|
|
- CentOS 7 (beta)
|
2023-08-22 20:26:29 +02:00
|
|
|
- Fedora 38 (beta)
|
2021-08-20 21:45:39 +02:00
|
|
|
- RHEL 7 (beta)
|
2018-05-30 18:42:03 +02:00
|
|
|
|
2021-03-24 15:27:22 +01:00
|
|
|
**Note**: You should not use the `root` user to run the installation.
|
2022-02-24 00:17:21 +01:00
|
|
|
If you are using a [remote server](remote.md), see
|
2018-10-20 05:52:38 +02:00
|
|
|
the
|
2022-02-16 01:39:15 +01:00
|
|
|
[section on creating appropriate user accounts](remote.md#setting-up-user-accounts).
|
2018-10-20 05:52:38 +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
|
|
|
|
2023-04-27 20:38:58 +02:00
|
|
|
CentOS, Fedora, and RHEL users should ensure that python3 is installed on their
|
|
|
|
systems (Debian and Ubuntu distributions already include it):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# On CentOS/Fedora/RHEL, you must first install python3.
|
|
|
|
# For example, this command installs python3 with yum:
|
|
|
|
yum install python
|
|
|
|
```
|
|
|
|
|
|
|
|
With python3 installed, change into the directory where you have cloned
|
|
|
|
Zulip and run the following commands:
|
|
|
|
|
2021-08-20 07:09:04 +02:00
|
|
|
```bash
|
2023-04-27 20:38:58 +02:00
|
|
|
# From inside 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
|
2023-03-04 02:17:54 +01:00
|
|
|
./tools/run-dev # starts the development server
|
2016-11-28 02:50:33 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Once you've done the above setup, you can pick up the [documentation
|
|
|
|
on using the Zulip development
|
2022-09-10 02:31:23 +02:00
|
|
|
environment](setup-recommended.md#step-4-developing),
|
2016-11-28 02:50:33 +01:00
|
|
|
ignoring the parts about `vagrant` (since you're not using it).
|
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
## Installing using Vagrant with VirtualBox on Windows 10
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
:::{note}
|
2024-03-12 20:28:44 +01:00
|
|
|
We recommend using [WSL 2 for Windows development](setup-recommended.md)
|
2022-08-18 22:58:47 +02:00
|
|
|
because it is easier to set up and provides a substantially better experience.
|
|
|
|
:::
|
2021-10-29 22:42:06 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
1. Install [Git for Windows][git-bash], which installs _Git BASH_.
|
|
|
|
2. Install [VirtualBox][vbox-dl] (latest).
|
|
|
|
3. Install [Vagrant][vagrant-dl] (latest).
|
2021-10-29 22:42:06 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
(Note: While _Git BASH_ is recommended, you may also use [Cygwin][cygwin-dl].
|
|
|
|
If you do, make sure to **install default required packages** along with
|
|
|
|
**git**, **curl**, **openssh**, and **rsync** binaries.)
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Also, you must have hardware virtualization enabled (VT-x or AMD-V) in your
|
|
|
|
computer's BIOS.
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
#### Running Git BASH as an administrator
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
It is important that you **always run Git BASH with administrator
|
|
|
|
privileges** when working on Zulip code, as not doing so will cause
|
|
|
|
errors in the development environment (such as symlink creation). You
|
|
|
|
might wish to configure your Git BASH shortcut to always run with
|
|
|
|
these privileges enabled (see this [guide][bash-admin-setup] for how
|
|
|
|
to set this up).
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
##### Enable native symlinks
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
The Zulip code includes symbolic links (symlinks). By default, native Windows
|
|
|
|
symlinks are not enabled in either Git BASH or Cygwin, so you need to do a bit
|
|
|
|
of configuration. **You must do this before you clone the Zulip code.**
|
2021-08-20 22:54:08 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
In **Git for BASH**:
|
2020-11-07 06:00:41 +01:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Open **Git BASH as an administrator** and run:
|
2021-10-29 22:42:06 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
```console
|
|
|
|
$ git config --global core.symlinks true
|
|
|
|
```
|
2021-10-29 22:42:06 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Now confirm the setting:
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
```console
|
|
|
|
$ git config core.symlinks
|
|
|
|
true
|
|
|
|
```
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-09-10 02:31:23 +02:00
|
|
|
If you see `true`, you are ready for [Step 2: Get Zulip code](setup-recommended.md#step-2-get-zulip-code).
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Otherwise, if the above command prints `false` or nothing at all, then symlinks
|
|
|
|
have not been enabled.
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
In **Cygwin**:
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Open a Cygwin window **as an administrator** and do this:
|
2020-04-21 07:38:19 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
```console
|
|
|
|
christie@win10 ~
|
|
|
|
$ echo 'export "CYGWIN=$CYGWIN winsymlinks:native"' >> ~/.bash_profile
|
|
|
|
```
|
2021-10-29 22:42:06 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
Next, close that Cygwin window and open another. If you `echo` $CYGWIN you
|
|
|
|
should see:
|
2021-10-29 22:42:06 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
```console
|
|
|
|
christie@win10 ~
|
|
|
|
$ echo $CYGWIN
|
|
|
|
winsymlinks:native
|
|
|
|
```
|
2020-04-21 07:38:19 +02:00
|
|
|
|
2022-09-10 02:31:23 +02:00
|
|
|
Now you are ready for [Step 2: Get Zulip code](setup-recommended.md#step-2-get-zulip-code).
|
2020-04-08 07:59:44 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
(Note: The **GitHub Desktop client** for Windows has a bug where it
|
|
|
|
will automatically set `git config core.symlink false` on a repository
|
|
|
|
if you use it to clone a repository, which will break the Zulip
|
|
|
|
development environment, because we use symbolic links. For that
|
|
|
|
reason, we recommend avoiding using GitHub Desktop client to clone
|
|
|
|
projects and to instead follow these instructions exactly.)
|
2021-04-14 06:29:13 +02:00
|
|
|
|
2022-08-18 22:58:47 +02:00
|
|
|
[cygwin-dl]: https://cygwin.com
|
|
|
|
[git-bash]: https://git-for-windows.github.io
|
|
|
|
[vbox-dl]: https://www.virtualbox.org/wiki/Downloads
|
|
|
|
[vagrant-dl]: https://www.vagrantup.com/downloads.html
|
|
|
|
[bash-admin-setup]: https://superuser.com/questions/1002262/run-applications-as-administrator-by-default-in-windows-10
|
2021-04-14 06:29:13 +02:00
|
|
|
|
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
|
2023-03-04 02:17:54 +01:00
|
|
|
(zulip-py3-venv) vagrant@ubuntu-18:/srv/zulip$ ./tools/run-dev
|
2021-01-21 10:38:57 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
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
|
2021-08-20 21:53:28 +02:00
|
|
|
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
|
|
|
|
2023-03-04 02:17:54 +01:00
|
|
|
2. Be patient the first time you run `./tools/run-dev`.
|
2021-01-21 10:38:57 +01:00
|
|
|
|
|
|
|
As with other installation methods, please visit [#provision
|
|
|
|
help][provision-help] in the [Zulip development community
|
2021-12-09 20:15:18 +01:00
|
|
|
server](https://zulip.com/development-community/) if you need help.
|
2021-01-21 10:38:57 +01:00
|
|
|
|
2024-06-06 21:48:31 +02:00
|
|
|
[provision-help]: https://chat.zulip.org/#narrow/channel/21-provision-help
|
2021-01-21 10:38:57 +01:00
|
|
|
|
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
|
2021-08-20 21:53:28 +02:00
|
|
|
Ubuntu that you're using, we'd love to add support for it. It's
|
2019-03-10 01:23:43 +01:00
|
|
|
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
|
2024-06-06 21:48:31 +02:00
|
|
|
[#development help](https://chat.zulip.org/#narrow/channel/49-development-help)
|
2021-12-09 20:15:18 +01:00
|
|
|
in [the Zulip development community](https://zulip.com/development-community/),
|
2021-11-18 07:25:55 +01:00
|
|
|
and a core team member can help guide you through adding support for the platform.
|
2021-11-02 23:50:41 +01:00
|
|
|
|
2022-02-16 01:39:15 +01:00
|
|
|
[zulip-rtd-git-cloning]: ../git/cloning.md#step-1b-clone-to-your-machine
|
|
|
|
[zulip-rtd-git-connect]: ../git/cloning.md#step-1c-connect-your-fork-to-zulip-upstream
|