### Install and Start Selenoid Source: https://github.com/pgadmin-org/pgadmin4/blob/master/web/regression/README.md Installs Selenoid and Selenoid UI using a bash script. Configure Selenoid with arguments to limit parallel sessions, CPU, and memory usage per session. Check status via the provided URLs. ```bash $curl -s https://aerokube.com/cm/bash | bash $./cm selenoid start --vnc --args "-limit 3 -cpu 1.5 -mem 1.5g" $./cm selenoid-ui start ``` -------------------------------- ### Run pgAdmin 4 Setup Script Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md Execute the setup script to initialize the configuration database. This can be done via the command line before starting pgAdmin 4. The process is interactive in server mode and non-interactive in desktop mode. ```bash (venv) $ python3 $PGADMIN4_SRC/web/setup.py ``` -------------------------------- ### Start the Runtime Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md Start the pgAdmin4 runtime after installing dependencies and configuring development settings. ```bash yarn run start ``` -------------------------------- ### Install Sphinx and sphinxcontrib-youtube Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md Install the necessary Python packages for building documentation using pip. ```bash $ source venv/bin/activate (venv) $ pip install Sphinx (venv) $ pip install sphinxcontrib-youtube ``` -------------------------------- ### Example Docker Image Tags Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/docker/README.md These are example tags that will be applied to the Docker image when using 'make docker'. ```bash pgadmin4 pgadmin4:latest pgadmin4:4 pgadmin4:4.12 ``` -------------------------------- ### Install Build Prerequisites Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/debian/README.md Run this script as root to install necessary dependencies for building Debian/Ubuntu packages. ```bash # pkg/debian/setup.sh ``` -------------------------------- ### Install and Build JS Dependencies Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/win32/README.md Navigate to the web directory and run these commands to install JavaScript dependencies and build the project. ```bash cd pgadmin4/web yarn install yarn run bundle ``` -------------------------------- ### Install Prerequisites for RPM Builds Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/redhat/README.md Run this script as root to install all necessary dependencies for building RPM packages. ```bash # pkg/redhat/setup.sh ``` -------------------------------- ### Start uWSGI for Sub-directory Hosting Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/server_deployment.rst This command starts the uWSGI server for pgAdmin 4, configured to be mounted in a sub-directory. The `--mount` parameter specifies the sub-directory path. ```bash uwsgi --socket /tmp/pgadmin4.sock \ --processes 1 \ --threads 25 \ --chdir /usr/lib/python3.7/dist-packages/pgadmin4/ \ --manage-script-name \ --mount /pgadmin4=pgAdmin4:app ``` -------------------------------- ### Install Docker Source: https://github.com/pgadmin-org/pgadmin4/blob/master/web/regression/README.md Installs Docker and configures it to disable SELinux. Ensure to edit the Docker configuration file to add the SELinux option. ```bash $yum -y install docker docker-registry $vi /etc/sysconfig/docker # in OPTIONS add ‘--selinux-enabled=false’ $systemctl enable docker.service $systemctl start docker.service $systemctl status docker.service ``` -------------------------------- ### Build zlib Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/win32/README.md Download, compile, and install zlib into the build directory. ```batch wget https://zlib.net/zlib-1.3.11.tar.gz tar -zxvf zlib-1.3.1.tar.gz cd zlib-1.3.1 nmake -f win32/Makefile.msc mkdir c:\build64\zlib mkdir c:\build64\zlib\bin copy zlib1.dll c:\build64\zlib\bin\ copy zlib1.pdb c:\build64\zlib\bin\ mkdir c:\build64\zlib\include copy zlib.h c:\build64\zlib\include\ copy zconf.h c:\build64\zlib\include\ mkdir c:\build64\zlib\lib copy zlib.lib c:\build64\zlib\lib\ copy zlib.pdb c:\build64\zlib\lib\ copy zdll.lib c:\build64\zlib\lib\ copy zdll.exp c:\build64\zlib\lib\ cd .. ``` -------------------------------- ### Start pgAdmin 4 Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md Launch pgAdmin 4 from the command line. This command will start the application, and you can then access it via a web browser using the URL provided in the terminal output. This method works for both server and desktop modes. ```bash (venv) $ python3 $PGADMIN4_SRC/web/pgAdmin4.py ``` -------------------------------- ### Add User with setup.py Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/user_management.rst Use the 'add-user' command with email and password. Optional fields include role and active status. Specify roles using '--admin' or '--role'. ```bash /path/to/python /path/to/setup.py add-user user1@gmail.com password ``` ```bash /path/to/python /path/to/setup.py add-user user1@gmail.com password --admin ``` ```bash /path/to/python /path/to/setup.py add-user user1@gmail.com password --role Users ``` ```bash /path/to/python /path/to/setup.py add-user user1@gmail.com password --active ``` ```bash /path/to/python /path/to/setup.py add-user user1@gmail.com password --inactive ``` -------------------------------- ### Load servers via command line Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/import_export_servers.rst Use the setup.py script to import server definitions from a JSON file. Specify the user email and optionally the path to the SQLite configuration database. ```bash /path/to/python /path/to/setup.py load-servers input_file.json --user user@example.com ``` ```bash /path/to/python /path/to/setup.py load-servers input_file.json --sqlite-path /path/to/pgadmin4.db ``` -------------------------------- ### Load Users with setup.py Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/user_management.rst Bulk import users by invoking setup.py with the 'load-users' command, followed by the path to a JSON file containing user data. ```bash /path/to/python /path/to/setup.py load-users /path/to/users.json ``` -------------------------------- ### uWSGI Command for NGINX Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/server_deployment.rst Command to start uWSGI for use with NGINX, binding to a Unix socket. Adjust paths for your installation. ```bash uwsgi --socket /tmp/pgadmin4.sock \ --processes 1 \ --threads 25 \ ``` -------------------------------- ### Get User Details with setup.py Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/user_management.rst Invoke setup.py with the 'get-users' command to list all users or retrieve details for a specific user by providing their username or email address. ```bash # to list all the users: /path/to/python /path/to/setup.py get-users ``` ```bash # to get the user's details: /path/to/python /path/to/setup.py get-users --username user1@gmail.com ``` -------------------------------- ### Gunicorn Command for NGINX (Root/Sub-directory) Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/server_deployment.rst Command to start Gunicorn for use with NGINX, binding to a Unix socket. Adjust paths for your installation. ```bash gunicorn --bind unix:/tmp/pgadmin4.sock \ --workers=1 \ --threads=25 \ --chdir /usr/lib/python3.7/dist-packages/pgadmin4 \ pgAdmin4:app ``` -------------------------------- ### Import Servers using setup.py Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/import_export_servers.rst Use this command to import server definitions from a JSON file. Specify the input file name. By default, imported servers are added to the existing list. Use the --replace option to overwrite existing servers. Options are available to specify a different user or pgAdmin config DB file. ```bash /path/to/python /path/to/setup.py load-servers input_file.json ``` ```bash # or, to replace the list of servers with the newly imported one: /path/to/python /path/to/setup.py load-servers input_file.json --replace ``` ```bash # or, to specify a non-default user name and auth source (the default is Internal) to own the new servers: ``` -------------------------------- ### Install Regression Test Dependencies Source: https://github.com/pgadmin-org/pgadmin4/blob/master/web/regression/README.md Installs the necessary packages for running regression tests. Ensure you are in a Python environment with pgAdmin4 prerequisites installed. ```bash (pgadmin4) $ pip install -r $PGADMIN4_SRC/web/regression/requirements.txt ``` -------------------------------- ### Install Virtualenv Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/win32/README.md Install the virtualenv package to manage isolated Python environments. ```powershell pip install virtualenv ``` -------------------------------- ### Build Documentation Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md Build the project documentation using the Makefile. ```bash (venv) $ make docs ``` -------------------------------- ### Install xsel for Linux Environments Source: https://github.com/pgadmin-org/pgadmin4/blob/master/web/regression/README.md Installs the 'xsel' utility on Linux systems, which is required by Pyperclip for copy/paste operations. Failure to install may result in a 'Pyperclip could not find a copy/paste mechanism' error. ```bash (pgadmin4) $ sudo apt-get install xsel ``` -------------------------------- ### Set PostgreSQL Installation Directory Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/mac/README.md Set the PGADMIN_POSTGRES_DIR environment variable if PostgreSQL is installed in a non-default location. ```bash export PGADMIN_POSTGRES_DIR=/opt/local/pgsql ``` -------------------------------- ### Install pl/pgsql Language Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/pgagent_install.rst Ensure the pl/pgsql procedural language is installed in the database. This is a prerequisite for pgAgent functionality. ```sql CREATE LANGUAGE plpgsql; ``` -------------------------------- ### Export Servers using setup.py Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/import_export_servers.rst Use this command to export server definitions to a JSON file. Specify the output file name. By default, it exports servers for the desktop mode user. Options are available to specify a different user, authentication source, or pgAdmin config DB file. ```bash /path/to/python /path/to/setup.py dump-servers output_file.json ``` ```bash # or, to specify a non-default user name and auth source (the default is Internal): /path/to/python /path/to/setup.py dump-servers output_file.json --user user@example.com --auth_source ldap ``` ```bash # to specify a pgAdmin config DB file: /path/to/python /path/to/setup.py dump-servers output_file.json --sqlite-path /path/to/pgadmin4.db ``` ```bash /path/to/python /path/to/setup.py dump-servers output_file.json --server 1 --server 2 --server 5 ``` -------------------------------- ### Run Build Command Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/win32/README.md Execute the 'make' command to build the installer. If a code signing certificate is available in the Windows Certificate Store, it will be used automatically. ```bash make ``` -------------------------------- ### Add External User with setup.py Source: https://github.com/pgadmin-org/pgadmin4/blob/master/docs/en_US/user_management.rst Use 'add-external-user' with username and authentication source. Email, role, and status are optional. Roles can be specified with '--admin' or '--role'. ```bash /path/to/python /path/to/setup.py add-external-user user1@gmail.com ldap ``` ```bash /path/to/python /path/to/setup.py add-external-user ldapuser ldap --email user1@gmail.com ``` ```bash /path/to/python /path/to/setup.py add-external-user ldapuser ldap --admin ``` ```bash /path/to/python /path/to/setup.py add-external-user ldapuser ldap --role Users ``` ```bash /path/to/python /path/to/setup.py add-external-user user1@gmail.com ldap --active ``` ```bash /path/to/python /path/to/setup.py add-external-user user1@gmail.com ldap --inactive ``` -------------------------------- ### Install Node.js and Yarn (macOS) Source: https://github.com/pgadmin-org/pgadmin4/blob/master/web/regression/README.md Install Node.js and Yarn on macOS using Homebrew or MacPorts. These are prerequisites for running Javascript tests. ```bash brew install nodejs brew install yarn ``` ```bash sudo port install nodejs7 yarn ``` -------------------------------- ### Install Regression Test Requirements Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md If planning to run regression tests, install the additional requirements specified in the regression test requirements file. ```bash (venv) $ pip install -r $PGADMIN4_SRC/web/regression/requirements.txt ``` -------------------------------- ### Build Web Assets on *nix Systems Source: https://github.com/pgadmin-org/pgadmin4/blob/master/README.md Commands to download required packages and build the web asset bundle on *nix systems using make. Ensure you have Yarn installed. ```bash $ cd $PGADMIN4_SRC $ make install-node $ make bundle ``` -------------------------------- ### Install Build Tools via Chocolatey Source: https://github.com/pgadmin-org/pgadmin4/blob/master/pkg/win32/README.md Install essential command line utilities and build tools required for the pgAdmin build process. ```powershell choco install -y awk bzip2 cmake diffutils dotnet3.5 gnuwin32-coreutils.install gzip git html-help-workshop meson innosetup ninja nodejs-lts python sed strawberryperl wget winflexbison3 yarn ```