# Installation - Quick Guide

## Preparation

If you already have a server - be it running on Apache or Nginx - and you know some basics of adding one more website to the existing server, you can read this quick guide to set up an instance in 3 mins.

What you need to run an instance properly include:

* PHP 7.X (extensions required: `php-curl`, `fileinfo`, `imagemagick`, `exif`)
* MySQL
* SSL (you can easily get it from Cloudflare for free)
* A domain (recommend you use a subdomain such as `app.yourcompany.vc`)&#x20;

You only need to do 3 steps to finish the installation process.

## Step 1: Configure the website

**Redirect**: The website will try to hide the ".php" extension for all the links. Therefore, you need to link `https://yoursite.name/abc` to `https://yoursite.name/abc.php`.

On a Nginx server, you can add the following lines to your new website configuration block.

```
server
{
    ...
    
    location / {
        try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
    }
}
```

**Most importantly, we use `.env` to save all your configurations. Please make sure `.env` file is not accessible by the public.**

On a **Nginx** server, you can add the following line to your new website configuration block.

```
server
{
    ...
    
    location ~ /\. {
        deny all;
    }
}
```

Using **Apache**, you can add the following to your `.htaccess` file:

```
<FilesMatch "^\.">
    Order allow,deny
    Deny from all
</FilesMatch>
```

**PHP**: The scripts use short tag \<? instead of \<?php to start. Therefore, you will need to turn`short_open_tag = On` for your PHP. You also want to increase the upload size limit to allow large attachments uploading. In your `php.ini` file, change the settings as shown below.

```
# Edit this in your php.ini file
short_open_tag = on
upload_max_filesize = 200M;
post_max_size = 200M;
```

To allow large attachments uploading (>2M), you also want to update the settings for you Nginx server.

```
$ sudo nano /etc/nginx/nginx.conf

# Change or add the following value in this document to a large value such as 200M
client_max_body_size 200M;

$ sudo systemctl reload nginx
```

## Step 2: Clone the project to your server

To get a copy of this, please contact `hello@avocado.vc` to get your API Key/Secret first. Clone the project to your server. Go to your web server root folder (e.g. `/var/www`) and run the following command to clone a copy. Replace `DOMAIN`, `API_KEY` , `API_SECRET` with your own ones.

```
$ curl "https://api.avocado.vc/install?domain=DOMAIN&key=API_KEY&secret=API_SECRET" --output install.sh && bash install.sh
```

## Step 3: Finish installation

Go to your website, and you will be redirected to the installation page automatically if everything works properly. For example, in this case, we can open `https://demo.avocado.vc`

You will need to set up your super admin account and provide the MySQL database connection information.

![Installation page](https://766800009-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUQxWMwNjtCbmVILxp1%2F-MURCqUrjFUhcr5nO5RL%2F-MURg8jduKYaIUagwOE_%2Fimage.png?alt=media\&token=458aea05-0841-49e5-8a0f-f36a89dfc8aa)

Once you have successfully installed, you will be redirected to the login page. You can now login with the super admin account that you just set up. You can also change any setting or customize the site under "Settings" once you log into the platform.

![](https://766800009-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUQxWMwNjtCbmVILxp1%2F-MUXYCTHAart2YYunXL1%2F-MUXa0MGUyNJJEMczB2m%2Fimage.png?alt=media\&token=7e15ce08-a08c-4c88-bb11-ba3f98836480)
