# Installation

Last updated: May 25th, 2022

## Introduction

The installation of JupiterMeet Pro is very easy and straightforward. This guide will help you run the bash script which will install and configure all the dependencies required to run the project properly on a clean Ubuntu 18.04 or CentOS 7 server. A basic knowledge of terminal is required.

Please follow all the steps very carefully. Once you have the dependencies installed, you can use the web installer to install the application from the browser itself.

## VPS

Ubuntu 18.04 or CentOS 7 with minimum of 12 GB RAM is a recommended VPS.

Check out this link to get a cheap VPS hosting.

## Automatic installation

Make sure the server is empty, otherwise it may create issues. Click here if you prefer the manual way.

1. Upload the bash script (jupitermeet-installation.sh) and the application (jupitermeet.zip) to your server

   Note: Place the zip and the script in same directory

2. Set execute permission on script

   `chmod 700 jupitermeetpro-installation.sh`

3. Execute the script

   `./jupitermeetpro-installation.sh`

Once the installation is finished, note down all the details it returns.

## Application setup

- Open yourdomain.in/install in the browser
- .env section: Follow all the steps very carefully and udpate the values as below
  Application
  - APP_ENV: local or production. Based upon where you want to setup
  - APP_KEY: No need to change
  - APP_DEBUG: true or false. Generally, true in local server and false on production
  - APP_LOG_LEVEL: No need to change
  - APP_URL: Your application URL
  Database
  - DB_CONNECTION: No need to change
  - DB_HOST: No need to change
  - DB_PORT: No need to change
  - DB_DATABASE: Database name that you created in the above step
  - DB_USERNAME: Database username
  - DB_PASSWORD: Database password
  Email
  - MAIL_DRIVER: Email driver
  - MAIL_HOST: Email host
  - MAIL_PORT: Email port
  - MAIL_USERNAME: Email username
  - MAIL_PASSWORD: Email password
  - MAIL_ENCRYPTION: Email encryption
  - MAIL_FROM_NAME: Your application name
  - MAIL_FROM_ADDRESS: Your email address
- Please add qoutes if env variables have space in it
- Click save and Install (Make sure you click 'Save .env' before clicking on Install)

### Turn on 'less secure apps' from your Google account to allow the application to send emails

1. Go to your (Google Account).
2. On the left navigation panel, click Security.
3. On the bottom of the page, in the Less secure app access panel, click Turn on access.
4. Click the Save button.

### Note: The application will send emails in the following cases,

- Reset password
- Meeting invitation

## Signaling

Navigate to the /server directory from terminal.

`cd /var/www/html/jupitermeet_pro/server`

Update .env file to match your requirements

- KEY_PATH: Path to your SSL key
- CERT_PATH: Path to your SSL certificate
- DOMAIN: Your domain with https
- PORT: Port to run NodeJS on
- MAX_FILESIZE: In MB
- USER_LIMIT_PER_MEETING: Users allowed per meeting
- IP: Server's IP address
- ANNOUNCED_IP: Useful when running application behind NAT with private IP
- RTC_MIN_PORT: Minimun RTC port
- RTC_MAX_PORT: Maximum RTC port

Run on production

`npm run production`

Run on local server

`npm run local`

Save the processes

`pm2 save`

## Configuration

### Storage link (optional)

If you see a broken logo, that means the storage link has not been created, use this command (from root project directory)

`php artisan storage:link`

### Global Configuration

- Login and navigate to the Admin > Global Configuration module
- Here you can update application name, logo, theme color etc
- Update the Signaling URL with your domain and port

## Payment Configuration

- Enable payment mode from Admin > Global Configuration
- Extended License is required to enable the payment mode. Updrade to the Extended License
- Login and navigate to the Admin > Manage Payment > Payment Gateways
- Here you can enable payments and set payment credentials

### Stripe

- Login into your Stripe account
- Go to the Developers section of the Stripe dashboard and click on API Keys
- Copy the Publishable key and Secret key in Admin > Manage Payment > Payment Gateways > Stripe
- From the sidebar, go to the Developers section of the Stripe dashboard and click on Webhooks. and Click on Add a new endpoint
- On the `Endpoint URL` field paste your webhook URL, this can be found on Admin > Manage Payment > Payment Gateways > Stripe.
- On the Events to send field, click on receive all events, and click the Add endpoint button.
- Copy the `Signing secret` in Admin > Manage Payment > Payment Gateways > Stripe.

### PayPal

- Login into your Paypal account
- Go to the My apps & credentials section, click on Live button and then on the Create app button.
- Copy the `Client ID` and `Secret` in Admin > Manage Payment > Payment Gateways > PayPal.
- Go to the My apps & credentials section, click on Live button and then select your app.
- Scroll down to LIVE WEBHOOKS and click on the Add webhook button.
- On the `Webhook URL` field paste your webhook URL. This can be found on Admin > Manage Payment > Payment Gateways > PayPal.
- Under the Events types select All events and save your changes.
- Copy the Webhook ID in Admin > Manage Payment > Payment Gateways > PayPal.

## Localization

To add a new language, Download the Sample English File from the Languages section in the Admin panel. After editing to your language, click on the Create button and add that edited file.

When an update is made and more texts are added to the English file, download the sample as well as your language file, translate the difference and save it.

## Configure Firewall (optional)

If Firewall is active, please open the below ports for signaling server.

- 443 TCP
- 9007 TCP
- From RTC_MIN_PORT to RTC_MAX_PORT UDP

## Manage Processes

Manage processes with PM2

### Manage NodeJS

View running processes

`pm2 list`

Restart NodeJS server

`pm2 restart JupiterMeetPro`

## Renew SSL

Let's Encryt will renew certificates automatically but if you need to do it manually, use the below command.

`certbot renew`

## Troubleshooting

- Make sure NodeJS server is up and running
- Make sure frontend is pointing to the NodeJS server with your signaling port (9007)
- If firewall is active, make sure the ports are allowed
- If the application is running behind NAT with private IP, add ANNOUNCED_IP in /server/.env
- Make sure the app is running on https
- Make sure the SSL certificates are valid
- Make sure no antivirus softwares are blocking the media device access
- To reflect the changes, please clear browser cache or hard reload the page