<commit_before># Installation

## XOA

Log in to your account and use the deploy form [available on this page](https://xen-orchestra.com/#!/xoa).

:::tip
All the deploy code is within your browser, nothing is sent to our server!
:::

![](./assets/deploy_form.png)

### First Login

Once you have started the VM, you can access the web UI by putting the IP you configured during deployment into your web browser. If you did not configure an IP or are unsure, try one of the following methods to find it:

- Run `xe vm-list params=name-label,networks | grep -A 1 XOA` on your host
- Check your router's DHCP leases for an `xoa` lease

:::tip

- Default Web UI credentials are `admin@admin.net` / `admin`
- Default console/SSH credentials are not set, you need to set them [as described here](troubleshooting.md#set-or-recover-xoa-vm-password).
  :::

### Registration

**The first thing** you need to do with your XOA is register. [Read the documentation on the page dedicated to the updater/register inferface](updater.md#register).

:::tip
We don't generate virtual appliances every month (unlike XO code itself). It's very likely you'll need to update Xen Orchestra after the initial deploy. You need to register to do so!
:::

### Trial

In your current Free XOA, register it in the "Updates" view in the main menu:

![](./assets/xo5updatemenu.png)

**To register your appliance, please use your email/password from your previous registration on xen-orchestra.com**:

![](./assets/xo5register.png)

Then you can click on "Start Trial", the green button:

![](./assets/xo5starttrial.png)

Remember to click on the Upgrade button after requesting a trial - this will download the **Premium Edition** for 15 days!

![](./assets/xo5updatebutton.png)

### Trial availability

In this update view, you can see when your trial will end:

![](./assets/xo5trialend.png)

:::tip
Don't worry! XOA will still work after the trial: you'll be forced to downgrade to Free version, but you won't lose any configuration data.
:::

### More on XOA

You can get all the info you want on XOA in its [dedicated section](xoa.md).

![](https://xen-orchestra.com/assets/xoa1.png)

## From the sources

:::warning
We don't provide pro support for this installation method. We cannot guarantee anything if it's used in production. Use it at your own risk!
:::

:::tip
Please consider using XOA before trying to play with the manual build, which can be difficult if you are not used to NodeJS and NPM.
:::

This installation has been validated against a fresh Debian 10 (Buster) x64 install. It should be nearly the same on other dpkg systems. For RPM based OS's, it should be close, as most of our dependencies come from NPM and not the OS itself.

As you may have seen in other parts of the documentation, XO is composed of two parts: [xo-server](https://github.com/vatesfr/xen-orchestra/tree/master/packages/xo-server/) and [xo-web](https://github.com/vatesfr/xen-orchestra/tree/master/packages/xo-web/). They can be installed separately, even on different machines, but for the sake of simplicity we will set them up together.

### Packages and Pre-requisites

#### NodeJS

XO needs Node.js. **Please always use latest Node LTS**.

We'll consider at this point that you've got a working node on your box. E.g:

```
$ node -v
v14.17.0
```

If not, see [this page](https://nodejs.org/en/download/package-manager/) for instructions on how to install Node.

#### Yarn

Yarn is a package manager that offers more guarantees than npm.

See [this page](https://yarnpkg.com/en/docs/install#debian-stable) for instructions on how to install Yarn.

#### Packages

XO needs the following packages to be installed. Redis is used as a database by XO.

For example, on Debian/Ubuntu:

```
$ apt-get install build-essential redis-server libpng-dev git python-minimal libvhdi-utils lvm2 cifs-utils
```

On Fedora/CentOS like:

```
$ dnf install redis libpng-devel git libvhdi-utils lvm2 cifs-utils make automake gcc gcc-c++
```

### Fetching the Code

You need to use the `git` source code manager to fetch the code. Ideally, you should run XO as a non-root user, and if you choose to, you need to set up `sudo` to be able to mount NFS remotes. As your chosen non-root (or root) user, run the following:

```
git clone -b master http://github.com/vatesfr/xen-orchestra
```

:::tip
`xo-server` and `xo-web` have been migrated to the [xen-orchestra](https://github.com/vatesfr/xen-orchestra) mono-repository - so you only need the single clone command above
:::

### Installing dependencies

Now that you have the code, you can enter the `xen-orchestra` directory and use `yarn` to install other dependencies. Then finally build it using `yarn build`. Be sure to run `yarn` commands as the same user you will be using to run Xen Orchestra:

```
$ cd xen-orchestra
$ yarn
$ yarn build
```

Now you have to create a config file for `xo-server`:

```
$ cd packages/xo-server
$ mkdir -p ~/.config/xo-server
$ cp sample.config.toml ~/.config/xo-server/config.toml
```

> Note: If you're installing `xo-server` as a global service, you may want to copy the file to `/etc/xo-server/config.toml` instead.

In this config file, you can change default ports (80 and 443) for xo-server. If you are running the server as a non-root user, you will need to set the port to 1024 or higher.

You can try to start xo-server to see if it works. You should have something like this:<commit_msg>feat(docs/installation): integrate old from_the_sources changes<commit_after># Installation

## XOA

Log in to your account and use the deploy form [available on this page](https://xen-orchestra.com/#!/xoa).

:::tip
All the deploy code is within your browser, nothing is sent to our server!
:::

![](./assets/deploy_form.png)

### First Login

Once you have started the VM, you can access the web UI by putting the IP you configured during deployment into your web browser. If you did not configure an IP or are unsure, try one of the following methods to find it:

- Run `xe vm-list params=name-label,networks | grep -A 1 XOA` on your host
- Check your router's DHCP leases for an `xoa` lease

:::tip

- Default Web UI credentials are `<EMAIL>` / `<PASSWORD>`
- Default console/SSH credentials are not set, you need to set them [as described here](troubleshooting.md#set-or-recover-xoa-vm-password).
  :::

### Registration

**The first thing** you need to do with your XOA is register. [Read the documentation on the page dedicated to the updater/register inferface](updater.md#register).

:::tip
We don't generate virtual appliances every month (unlike XO code itself). It's very likely you'll need to update Xen Orchestra after the initial deploy. You need to register to do so!
:::

### Trial

In your current Free XOA, register it in the "Updates" view in the main menu:

![](./assets/xo5updatemenu.png)

**To register your appliance, please use your email/password from your previous registration on xen-orchestra.com**:

![](./assets/xo5register.png)

Then you can click on "Start Trial", the green button:

![](./assets/xo5starttrial.png)

Remember to click on the Upgrade button after requesting a trial - this will download the **Premium Edition** for 15 days!

![](./assets/xo5updatebutton.png)

### Trial availability

In this update view, you can see when your trial will end:

![](./assets/xo5trialend.png)

:::tip
Don't worry! XOA will still work after the trial: you'll be forced to downgrade to Free version, but you won't lose any configuration data.
:::

### More on XOA

You can get all the info you want on XOA in its [dedicated section](xoa.md).

![](https://xen-orchestra.com/assets/xoa1.png)

## From the sources

:::warning
We don't provide pro support for this installation method. We cannot guarantee anything if it's used in production. Use it at your own risk!
:::

:::tip
Please consider using XOA before trying to play with the manual build, which can be difficult if you are not used to NodeJS and NPM.
:::

This installation has been validated against a fresh Debian 10 (Buster) x64 install. It should be nearly the same on other dpkg systems. For RPM based OS's, it should be close, as most of our dependencies come from NPM and not the OS itself.

As you may have seen in other parts of the documentation, XO is composed of two parts: [xo-server](https://github.com/vatesfr/xen-orchestra/tree/master/packages/xo-server/) and [xo-web](https://github.com/vatesfr/xen-orchestra/tree/master/packages/xo-web/). They can be installed separately, even on different machines, but for the sake of simplicity we will set them up together.

### Packages and Pre-requisites

#### NodeJS

XO needs Node.js. **Please always use latest Node LTS**.

We'll consider at this point that you've got a working node on your box. E.g:

```
$ node -v
v16.14.0
```

If not, see [this page](https://nodejs.org/en/download/package-manager/) for instructions on how to install Node.

#### Yarn

Yarn is a package manager that offers more guarantees than npm.

See [this page](https://yarnpkg.com/en/docs/install#debian-stable) for instructions on how to install Yarn.

#### Packages

XO needs the following packages to be installed. Redis is used as a database by XO.

For example, on Debian/Ubuntu:

```
$ apt-get install build-essential redis-server libpng-dev git python3-minimal libvhdi-utils lvm2 cifs-utils
```

On Fedora/CentOS like:

```
$ dnf install redis libpng-devel git libvhdi-utils lvm2 cifs-utils make automake gcc gcc-c++
```

### Fetching the Code

You need to use the `git` source code manager to fetch the code. Ideally, you should run XO as a non-root user, and if you choose to, you need to set up `sudo` to be able to mount NFS remotes. As your chosen non-root (or root) user, run the following:

```
git clone -b master https://github.com/vatesfr/xen-orchestra
```

:::tip
`xo-server` and `xo-web` have been migrated to the [xen-orchestra](https://github.com/vatesfr/xen-orchestra) mono-repository - so you only need the single clone command above
:::

### Installing dependencies

Now that you have the code, you can enter the `xen-orchestra` directory and use `yarn` to install other dependencies. Then finally build it using `yarn build`. Be sure to run `yarn` commands as the same user you will be using to run Xen Orchestra:

```
$ cd xen-orchestra
$ yarn
$ yarn build
```

Now you have to create a config file for `xo-server`:

```
$ cd packages/xo-server
$ mkdir -p ~/.config/xo-server
$ cp sample.config.toml ~/.config/xo-server/config.toml
```

> Note: If you're installing `xo-server` as a global service, you may want to copy the file to `/etc/xo-server/config.toml` instead.

In this config file, you can change default ports (80 and 443) for xo-server. If you are running the server as a non-root user, you will need to set the port to 1024 or higher.

You can try to start xo-server to see if it works. You should have something like this:
{'fraction_non_alphanumeric': 0.099441443091292, 'fraction_numerical': 0.005402435674388792, 'mean_word_length': 4.0588235294117645, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 15, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6773558', 'n_tokens_mistral': 3464, 'n_tokens_neox': 3263, 'n_words': 1537}