ever-co / ever-gauzy

Ever® Gauzy™ - Open Business Management Platform (ERP/CRM/HRM/ATS/PM) - https://gauzy.co
https://gauzy.co
GNU Affero General Public License v3.0
2.29k stars 543 forks source link

[Question] Installing gauzy server on AWS EC2 Ubuntu #7680

Closed umair975 closed 8 months ago

umair975 commented 8 months ago

Is there any step-by-step guide that I can follow to setup Gauzy on a new EC2 instance or install it on an existing NGINX server? I tried to setup a new instance, copied the server installer, and then ran the command:

sudo dpkg -i gauzy-server-0.459.28.deb 

but it gave me dependency errors.

then tried to run

sudo apt-get -f install

and now upon running

sudo dpkg -i gauzy-server-0.459.28.deb 

getting error.

(Reading database ... 103049 files and directories currently installed.)
Preparing to unpack gauzy-server-0.459.28.deb ...
Unpacking gauzy-server (0.459.28) over (0.459.28) ...
dpkg: error processing archive gauzy-server-0.459.28.deb (--install):
 cannot copy extracted data for './opt/Gauzy Server/gauzy-server' to '/opt/Gauzy Server/gauzy-server.dpkg-new': failed to write (No space left on device)
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
update-alternatives is /usr/bin/update-alternatives
/var/lib/dpkg/info/gauzy-server.postinst: line 17: update-desktop-database: command not found
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 gauzy-server-0.459.28.deb
evereq commented 8 months ago

Hi @umair975 , seems your error suggests you don't have space on the drive - "(No space left on device)". The easiest way to run it either with setup file that you try to use OR using Docker. Please see Wiki - https://github.com/ever-co/ever-gauzy/wiki/Setup-Gauzy-(Self-Hosted) and specifically also https://github.com/ever-co/ever-gauzy/wiki/Gauzy-Self%E2%80%90Hosted-Setup-in-DigitalOcean#digitalocean-droplets which shows how to deploy using Docker / Docker Compose to some virtual instance / droplet (you can check GitHub actions to see how we do it)

umair975 commented 8 months ago

Unfortunately DO or Docker is not a option for me. I would like to install this on a fresh VM (EC2).

umair975 commented 8 months ago

I have also tried to clone the repo and run yarn start but no luck there

yarn start:api:pm2

yarn run v1.22.22
$ cross-env NODE_ENV=development NODE_OPTIONS=--max-old-space-size=12288 yarn run build:api && yarn ts-node -r tsconfig-paths/register --project apps/api/tsconfig.app.json ./apps/api/src/pm2bootstrap.ts
/bin/sh: 1: cross-env: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
evereq commented 8 months ago

@umair975 please check our README file https://github.com/ever-co/ever-gauzy/blob/develop/README.md#manually, it feels like you missed it... The error you are getting now is because you seem to not run yarn install in the root of the folder where you copy the platform source... (because it just can't find package "cross-env".

Unfortunately, we can't support you more with those questions because it's not bug reports, but more like attempts to setup projects on your specific server... I can only recommend researching our README / Wiki and possibly asking for help from someone who knows NodeJs infra well.

umair975 commented 8 months ago

sorry but the docs mentioned yarn bootstrap instead of yarn install.

evereq commented 8 months ago

from package.json:

"bootstrap": "yarn install && yarn lerna bootstrap",

So if you run yarn bootstrap it is supposed to install packages too, but I don't think you ran it or it's not succeeded, etc.

umair975 commented 8 months ago

even after running yarn install I am getting the same error cross-env: not found

this is what I have done.

Clone the repo to the web root

ran yarn install

then

yarn start:api:pm2

umair975 commented 8 months ago

this is a fresh EC2 Ubuntu 22 VM with 20GB disk space

evereq commented 8 months ago

@umair975 sorry but it means that your yarn install did not worked well for some reason, because that cross-env IS in list of packages - https://github.com/ever-co/ever-gauzy/blob/develop/package.json#L350

umair975 commented 8 months ago

What could have gone wrong?? It's a brand new VM even tried another one as well. I really want to set this up but facing lots of trouble making it work.

umair975 commented 8 months ago

First I provisioned arm but then the installer did not work due to not supported architecture. Then I provisioned x64 Ubuntu 22 barebones. Upload package via ftp and ran the commands. This time with 20gb disc space to avoid any storage issues.

evereq commented 8 months ago

What should work is this:

Note: that's NOT the best way / not production config etc, but it SHOULD have it run because essentially 1000s of devs doing it all the time with our and any other NodeJs apps on their personal PCs / Macs / Linux machines... Not recommended of course for live servers, but .... up to you... Try to at least run DB in AWS RDS, not run it on same instance in EC2 :)

umair975 commented 8 months ago

the server package won't work? not recommended for production setup?

umair975 commented 8 months ago

I tried what you mentioned but ended up with the same.. the server package supports linux. Is this something I can use on a fresh EC2 VM? on mac it works fine on linux it wont install.

Ever® Gauzy™ Server - includes Gauzy API, SQLite DB (or connects to external PostgreSQL) and serves Guazy frontend. It allows to quickly run Gauzy Server for multiple clients (browser-based or Desktop-based). It's a recommended option if you want to setup the Ever Gauzy Platform in small to medium organizations.

umair975 commented 8 months ago

fresh VM with the server package uploaded the files ran sudo apt install ./gauzy-server-0.459.28.deb then apt-get update ended up with this

update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode
Setting up liblwp-protocol-https-perl (6.10-1) ...
Setting up libxml-parser-perl:amd64 (2.46-3build1) ...
Setting up libxml-twig-perl (1:3.52-1) ...
Setting up libnet-dbus-perl (1.2.0-1build3) ...
Setting up humanity-icon-theme (0.6.16) ...
Setting up ubuntu-mono (20.10-0ubuntu2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libglib2.0-0:amd64 (2.72.4-0ubuntu2.2) ...
Setting up libgtk-3-0:amd64 (3.24.33-1ubuntu2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
Setting up libgtk-3-bin (3.24.33-1ubuntu2) ...
Setting up libvte-2.91-0:amd64 (0.68.0-1) ...
Setting up libappindicator3-1 (12.10.1+20.10.20200706.1-0ubuntu1) ...
Setting up libvted-3-0:amd64 (3.10.0-1ubuntu1) ...
Setting up at-spi2-core (2.44.0-3) ...
Setting up libgtkd-3-0:amd64 (3.10.0-1ubuntu1) ...
Setting up tilix (1.9.4-2build1) ...
update-alternatives: using /usr/bin/tilix.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode
Setting up gauzy-server (0.459.28) ...
update-alternatives is /usr/bin/update-alternatives
update-alternatives: using /opt/Gauzy Server/gauzy-server to provide /usr/bin/gauzy-server (gauzy-server) in auto mode
/var/lib/dpkg/info/gauzy-server.postinst: line 17: update-desktop-database: command not found
Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.8+dfsg-1ubuntu0.2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
Scanning processes...                                                                                                                    
Scanning linux images...                                                                                                                 

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
N: Download is performed unsandboxed as root as file '/home/ubuntu/gauzy-server-0.459.28.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
umair975 commented 8 months ago

running gauzy-server gives the following error

gauzy-server: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory