Skip to content

DocsNG Installation and Administration Guide

Introduction

Welcome to the DocsNG Installation and Administration Guide. This guide will walk you through the process of installing and configuring DocsNG, a versatile document generation tool. DocsNG supports various installation methods, databases, and application servers to suit your requirements.

Installation Methods

DocsNG can be installed using several methods:

  1. From Cloud Marketplaces: You can deploy DocsNG from cloud marketplaces such as AWS, Azure and Google Cloud Marketplace. This method is suitable for cloud-based deployments.

  2. Direct Installation: You can install DocsNG directly on a Windows or Linux host. This method offers flexibility for on-premises installations.

  3. Docker Container: DocsNG can be containerized and run as a Docker container, making it easy to manage and scale.

Supported Databases

DocsNG supports a range of databases to store your data:

  • PostgreSQL: An open-source, powerful relational database. Default instance for cloud deployments.
  • MySQL or MariaDB: Reliable and popular open-source database management systems.
  • Microsoft SQL Server (MSSQL): A robust and feature-rich relational database system.
  • Oracle: A widely used enterprise database solution.

Supported Application Servers

You can deploy DocsNG on various application servers, including:

  • IIS (Internet Information Services): A web server for Windows servers.
  • Apache: A popular, open-source web server.
  • NGINX: A lightweight, high-performance web server and reverse proxy server.

Now, let's dive into the installation and administration process, step by step.

Installation from a Cloud Marketplace

Installing DocsNG from AWS Marketplace

In this section, we will guide you through the process of installing DocsNG from the AWS Marketplace. DocsNG is available as an Amazon Machine Image (AMI) server product, and you will be billed based on your usage per hour and the size of the server you deploy.

Prerequisites

Before you begin, make sure you have the following prerequisites in place:

  • An AWS account with the necessary permissions to launch instances from the AWS Marketplace.
  • Familiarity with AWS EC2 instances and security group configuration.

Step 1: Access AWS Marketplace

  1. Log in to your AWS Management Console.

  2. Navigate to the AWS Marketplace.

  3. Search for "DocsNG" in the AWS Marketplace.

  4. Select the DocsNG product you wish to install.

Step 2: Launch DocsNG Instance

  1. Click the Continue to Subscribe button.

  2. Review and accept the terms and conditions to subscribe to DocsNG.

  3. Choose the Launch with EC2 option.

  4. Follow the on-screen instructions to launch an EC2 instance based on the DocsNG AMI.

Step 3: Configure DocsNG

  1. Once your EC2 instance is running, you can access DocsNG directly from your web browser without any additional configuration.

  2. To access the DocsNG web interface, use the instance's Public IPv4 DNS hostname on the HTTPS protocol using port 5002.

    • URL: https://[Public IPv4 DNS]:5002
    • Admin Username: admin
    • Password: DocsNG*[Instance ID] (For example, the default password of an instance with ID i-0a12345bac4566 is DocsNG*i-0a12345bac4566)

Step 4: Start Using DocsNG

  1. With DocsNG installed and configured, you can start using the tool to generate documents and manage data.

  2. Ensure that you monitor and manage your EC2 instance's performance and costs through your AWS account.

Step 5: Billing

  1. Keep in mind that DocsNG is billed based on your usage per hour and the size of the AWS EC2 instance deployed.

  2. Monitor your AWS billing dashboard for detailed cost breakdowns.

And there you have it! You've successfully installed DocsNG from the AWS Marketplace and can now use it to simplify document generation and data management.

Installing DocsNG from Azure Marketplace

DocsNG is available on Azure Marketplace as a virtual machine (VM) product. You can deploy it and be billed based on the usage per hour and the size of the server you deploy.

  1. Access Azure Marketplace: Log in to your Azure account and navigate to the Azure Marketplace.

  2. Search for DocsNG: Use the search feature to find DocsNG in the Azure Marketplace.

  3. Select and Configure: Once you've found DocsNG, select it. You'll be prompted to configure your deployment. This includes selecting the machine type, setting up network configurations, and specifying storage requirements. The pricing will depend on the machine type you choose and the duration of usage.

  4. Deploy the Virtual Machine: After configuring the deployment settings, click on the deploy button. Azure will provision the virtual machine for you based on your configurations.

  5. Access DocsNG: Once the virtual machine is deployed and running, you can access DocsNG through your web browser. Use the instance's external IP address or DNS hostname to access DocsNG on https port 443 (Default https port).

    • URL: https://[Public IPv4 DNS]
  6. Admin Credentials: By default, you'll need to use the following default credentials to log in.

    • Admin Username: admin
    • Password: DocsNG*[VM ID] (For example, the default password of an VM with vmId f334a759-0eb8-4cf7-a074-b801708dd26e is DocsNG*f334a759-0eb8-4cf7-a074-b801708dd26e)

This installation method allows you to run DocsNG as a virtual machine on Azure and be billed according to the usage and virtual machine size you've configured.

Installing DocsNG from Google Cloud Marketplace

DocsNG is available on Google Cloud Marketplace as a virtual machine (VM) product. You can deploy it and be billed based on the usage per hour and the size of the server you deploy.

  1. Access Google Cloud Marketplace: Log in to your Google Cloud account and navigate to the Google Cloud Marketplace.

  2. Search for DocsNG: Use the search feature to find DocsNG in the Google Cloud Marketplace.

  3. Select and Configure: Once you've found DocsNG, select it. You'll be prompted to configure your deployment. This includes selecting the machine type, setting up network configurations, and specifying storage requirements. The pricing will depend on the machine type you choose and the duration of usage.

  4. Deploy the Virtual Machine: After configuring the deployment settings, click on the deploy button. Google Cloud will provision the virtual machine for you based on your configurations.

  5. Access DocsNG: Once the virtual machine is deployed and running, you can access DocsNG through your web browser. Use the instance's external IP address or DNS hostname to access DocsNG on https port 443 (Default https port).

    • URL: https://[Public IPv4 DNS]
  6. Admin Credentials: By default, you'll need to use the following default credentials to log in.

    • Admin Username: admin
    • Password: DocsNG*[VM ID] (For example, the default password of an VM with ID i-0a12345bac4566 is DocsNG*i-0a12345bac4566)

This installation method allows you to run DocsNG as a virtual machine on Google Cloud and be billed according to the usage and virtual machine size you've configured.

Installing DocsNG on a Host

Overview of the installation process on a Host

  • Install and configure the database: Depending on your preference, you can install and configure one of the supported databases such as PostgreSQL, MySQL/MariaDB, SQL Server or Oracle.
  • Install the latest version of .NET Core SDK and ASP.NET Core Runtime.
  • Install the application server. On windows IIS and on Linux NGINX.
  • Deploy DocsNG.
  • Configure database connection settings for DocsNG.

System Requirements

Minimum hardware requirements for DocsNG application

Minimum requirement
Processor 2 GHz single core
Memory 1 GB RAM
Disk space 500 MB

Supported operating systems

  • Windows
  • macOS
  • Alpine
  • CentOS
  • Debian
  • Fedora
  • openSUSE
  • SLES
  • Ubuntu

Supported Databases

  • PostgreSQL (Preferred)
  • MySQL
  • Orace
  • MS SQL

Database installation and configuration

Databases on Windows

Installation Guide for PostgreSQL on a Windows
  1. Download the PostgreSQL installer for Windows from the official website. You can choose between different versions and architectures, depending on your system and requirements.

  2. Run the installer and select the components you want to install. By default, the installer will install the PostgreSQL server, command-line tools, and GUI tools.

  3. Choose the destination directory for the installation. The default directory is C:\Program Files\PostgreSQL.

  4. Select the data directory where PostgreSQL will store its data. By default, the data directory is C:\Program Files\PostgreSQL\\data.

  5. Choose the port number on which PostgreSQL will listen for connections. The default port number is 5432.

  6. Choose the default locale used by PostgreSQL. This is important if you are working with non-English characters.

  7. Choose the password for the PostgreSQL superuser account (postgres). Make sure to choose a strong password that you will remember.

  8. Choose the options for the PostgreSQL service. You can choose to start the service automatically, allow the service to interact with the desktop, and run the service as a specific user.

  9. Once you have completed the installation process, PostgreSQL will be ready to use. You can start the PostgreSQL service from the Windows Services panel, or from the command line using the pg_ctl command.

  10. Finally, you may want to install a GUI tool like pgAdmin to help manage your PostgreSQL databases. You can download pgAdmin from the PostgreSQL website and install it on your Windows machine.

You should now have a working installation of PostgreSQL on your Windows machine.

Installation guide for MySQL or MariaDB on a Windows
  1. Download the installer:

  2. Run the installer:

    • For MySQL: Double-click the downloaded file to launch the installer. Click "Next" on the first screen, accept the license agreement, and click "Next" again. Choose the "Custom" installation type and click "Next". On the next screen, select the features you want to install and click "Next". Choose the installation directory and click "Next". Set a password for the root account and click "Next". Finally, click "Execute" to begin the installation.
    • For MariaDB: Double-click the downloaded file to launch the installer. Click "Next" on the first screen, accept the license agreement, and click "Next" again. Choose the "Custom" installation type and click "Next". On the next screen, select the features you want to install and click "Next". Choose the installation directory and click "Next". Set a password for the root account and click "Next". Finally, click "Execute" to begin the installation.
  3. Configure the server:

    • For MySQL: During installation, you should have the option to configure the server. If not, you can configure it later by opening the MySQL Command Line Client and entering the following command: mysql_secure_installation. This will prompt you to set the root password, remove anonymous users, disallow remote root login, and remove test databases. Follow the prompts to complete the configuration.
    • For MariaDB: During installation, you should have the option to configure the server. If not, you can configure it later by opening the MariaDB Command Line Client and entering the following command: mysql_secure_installation. This will prompt you to set the root password, remove anonymous users, disallow remote root login, and remove test databases. Follow the prompts to complete the configuration.
  4. Test the installation:

    • For MySQL: Open the MySQL Command Line Client and enter the root password when prompted. If you see the MySQL prompt (mysql>), the installation was successful.
    • For MariaDB: Open the MariaDB Command Line Client and enter the root password when prompted. If you see the MariaDB prompt (MariaDB>) the installation was successful.

You have successfully installed MySQL or MariaDB on your Windows machine.

Installation guide for Oracle Express Edition on a Windows
  1. Download the installer:

    First, download the Oracle Express Edition installer from the Oracle website. You will need to create an account and agree to the license agreement before downloading.

  2. Run the installer:

    Double-click the downloaded file to start the installation process. If prompted, choose to run the installer as an administrator.

  3. Choose installation options:

    On the first screen of the installer, you can choose the installation language and the location where you want to install Oracle Express Edition. Click "Next" to proceed.

  4. Configure database settings:

    On the next screen, you will need to configure the database settings. Choose the "Desktop Class" option and provide a password for the "SYS" and "SYSTEM" accounts. Make sure to remember this password as you will need it later. Click "Next" to proceed.

  5. Configure HTTP port:

    On the next screen, you can configure the HTTP port for Oracle Application Express (APEX). Choose a port number and click "Next" to proceed.

  6. Review summary and install:

    On the final screen, review the installation summary and click "Install" to start the installation process.

  7. Wait for installation to complete:

    The installation process may take several minutes to complete. During this time, you may be prompted to install additional software packages. Follow the on-screen instructions to complete these installations.

  8. Launch SQL Command Line:

    Once the installation is complete, you can launch the SQL Command Line by clicking on the "Start" menu, choosing "Oracle Database 18c Express Edition", and then clicking "Run SQL Command Line".

  9. Connect to the database:

    In the SQL Command Line, connect to the database by typing the following command:

    CONNECT username/password

    Replace "username" with the name of the user you want to connect as (for example, "SYS") and "password" with the password you provided during installation.

    Once connected, you can start using Oracle Express Edition.

    You have successfully installed Oracle Express Edition on your Windows machine.

Installation guide for Microsoft SQL Server Express Edition on Windows
  1. Download the installer: Go to the Microsoft SQL Server Express download page https://www.microsoft.com/en-us/sql-server/sql-server-downloads and click on the "Download now" button for the Express edition. Select the appropriate version (32-bit or 64-bit) and language, and then click on "Download".

  2. Run the installer: Once the download is complete, run the downloaded file to start the installer.

  3. Accept the license terms: Read the license agreement and accept the terms to proceed with the installation.

  4. Select the features to install: Choose the features you want to install. You can install only the Database Engine or add other components like Management Tools, Reporting Services, and Full-Text Search.

  5. Choose the installation directory: Select the installation directory for the software. The default location is "C:\Program Files\Microsoft SQL Server".

  6. Configure the instance: Enter a name for the instance or accept the default instance name. You can also choose to install a named instance, which allows you to install multiple instances of SQL Server on the same machine.

  7. Set the service accounts: Choose the service account for each SQL Server service. The default is to use the Local System account, but you can choose to use a domain account or a local account.

  8. Set the authentication mode: Choose the authentication mode for the SQL Server instance. You can choose either Windows Authentication mode or Mixed Mode (Windows Authentication and SQL Server Authentication).

  9. Configure the database engine: Set the collation for the database engine, enable or disable FILESTREAM, and choose the default language for the instance.

  10. Complete the installation: Review the summary and click on "Install" to begin the installation process. Once the installation is complete, you can launch the SQL Server Management Studio to start managing your SQL Server instance.

You have successfully installed Microsoft SQL Server Express Edition on your Windows machine.

Databases on Linux

Installation Guide for PostgreSQL on Linux (Ubuntu)
  1. Open a terminal window on your Linux machine.

  2. Update the package list and upgrade any existing packages by running the following command:

    sudo apt-get update && sudo apt-get upgrade
    
  3. Install PostgreSQL by running the following command:

    sudo apt-get install postgresql
    
  4. Once the installation is complete, you should see a message that says PostgreSQL has been installed and automatically started. You can check the status of the service by running the following command:

    sudo systemctl status postgresql.service
    

    If the service is running, you should see a message that says "Active: active (exited)".

  5. By default, PostgreSQL creates a user account called "postgres". You can switch to this user account by running the following command:

    sudo su - postgres
    
  6. Once you're logged in as the postgres user, you can access the PostgreSQL command line interface by running the following command:

    psql
    
    You should see a message that says "psql (version number)". This means you've successfully connected to the PostgreSQL server.

  7. You can now create a new user account and a new database. Here's an example of how to create a new user account called "myuser" and a new database called "mydatabase":

    CREATE USER myuser WITH PASSWORD 'mypassword';
    CREATE DATABASE mydatabase;
    GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser;
    

    This will create a new user account with the password "mypassword", a new database called "mydatabase", and grant all privileges to the "myuser" account.

    You've successfully installed PostgreSQL on your Linux machine and created a new user account and database.

installation Guide for MySQL or MariaDB on Linux (Ubuntu)
  1. Update the package repository: Run the following command to update the package repository on your Linux machine:

    sudo apt-get update
    

  2. Install MySQL or MariaDB: Run the following command to install MySQL or MariaDB:

    sudo apt-get install mysql-server
    
    or
    sudo apt-get install mariadb-server
    

  3. Secure the installation: After the installation, you should run the security script to set up the root user password and other security settings. Run the following command and follow the prompts:

    sudo mysql_secure_installation
    

  4. Start the service: Run the following command to start the MySQL or MariaDB service:

    sudo systemctl start mysql
    
    or
    sudo systemctl start mariadb
    

  5. Enable the service: Run the following command to enable the MySQL or MariaDB service to start automatically at boot time:

    sudo systemctl enable mysql
    
    or
    sudo systemctl enable mariadb
    

  6. Test the installation: You can test the installation by logging in to the MySQL or MariaDB server with the root user and password:

    mysql -u root -p
    
    or
    mariadb -u root -p
    

You now have MySQL or MariaDB installed and ready to use on your Linux machine.

Installation Guide for Oracle Express Edition on Linux (CentOS)
  1. Download the installation files: First, download the installation files for Oracle Express Edition from the Oracle website. You'll need to create an account if you don't already have one. The download file will have a name like "oracle-xe-19.0.0-0.0.x86_64.rpm.zip" (the exact version number may vary).

  2. Extract the files: Once you've downloaded the files, extract them to a directory of your choice. You can do this using the "unzip" command. For example, if you downloaded the file to your home directory, you could extract it with the command:

unzip oracle-xe-19.0.0-0.0.x86_64.rpm.zip
3. Install required packages: Before installing Oracle Express Edition, you'll need to install some required packages. Run the following command to install them:
sudo yum install oracle-database-preinstall-19c
Note: If you're using a version of Oracle Express Edition other than 19c, you'll need to adjust the package name accordingly.

  1. Install Oracle Express Edition: To install Oracle Express Edition, use the "rpm" command to install the RPM file you extracted in step 2. For example, if you extracted the file to your home directory, you could install it with the following command:

    sudo rpm -ivh /home/username/oracle-xe-19.0.0-0.0.x86_64.rpm
    
    Note: Again, adjust the file name according to the version you downloaded.

  2. Configure Oracle Express Edition: After installation is complete, you'll need to configure Oracle Express Edition. Run the following command:

    sudo /etc/init.d/oracle-xe-19c configure
    
    Follow the prompts to set up the database.

  3. Start Oracle Express Edition: Once you've configured the database, start it with the following command:

    sudo service oracle-xe-19c start
    
    You should now have Oracle Express Edition up and running on your Linux system.

Installation Guide for MS SQL Server Express Edition on Linux (Ubuntu)
  1. Update the package list on your Linux system:

    sudo apt-get update
    

  2. Import the GPG key for the Microsoft SQL Server repository:

    sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    

  3. Add the Microsoft SQL Server repository to your system:

    sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
    

Note: This command assumes that you are running Ubuntu 18.04. If you are using a different version of Linux, you will need to replace the URL with the appropriate one for your system.

  1. Install MS SQL Server Express Edition:

    sudo apt-get update
    sudo apt-get install -y mssql-server
    

  2. Once the installation is complete, run the configuration script to set up the MS SQL Server instance:

    sudo /opt/mssql/bin/mssql-conf setup
    

  3. Follow the prompts to set the system administrator (sa) password, choose the edition of MS SQL Server you want to use (Express, Developer, or Standard), and configure any additional settings as needed.

  4. Start the MS SQL Server service:

    sudo systemctl start mssql-server
    

  5. Check that the service is running:

    systemctl status mssql-server
    

You should see output indicating that the service is active and running.

You have now successfully installed MS SQL Server Express Edition on your Linux system.

Database and User Creation

PostgreSQL

Create a new database user for PostgreSQL

  1. Open a command prompt or terminal window and type psql to launch the PostgreSQL command-line interface.
  2. Type the following command to create a new user:
CREATE USER username WITH PASSWORD 'password';

Replace username with the desired username and password with a strong password for the user.

  1. If you want to grant the new user privileges to create and manage databases, you can run the following command:
ALTER USER username CREATEDB;

This will give the user the ability to create new databases.

Create a new database on PostgreSQL

  1. Open a command prompt or terminal window and type psql to launch the PostgreSQL command-line interface.
  2. Type the following command to create a new database:
CREATE DATABASE dbname;

Replace dbname with the desired name of the new database.

  1. If you want to grant a specific user permission to access the new database, you can run the following command:
GRANT ALL PRIVILEGES ON DATABASE dbname TO username;

Replace dbname with the name of the new database and username with the name of the user you want to grant access to.

You have now created a new database user and a new database in PostgreSQL.

MySQL or MariaDB

Create a database user and database on MySQL or MariaDB

  1. Log in to your MySQL or MariaDB server as the root user using the command line or a tool like phpMyAdmin.

  2. Create a new database by running the following command:

CREATE DATABASE dbname;
Replace dbname with the name you want to give to your new database.

  1. Create a new user by running the following command:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
Replace username with the name you want to give to your new user, and password with the password you want to use for the user.

  1. Grant the user access to the database by running the following command:

GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'localhost';
This command grants the user full privileges on the specified database.

  1. Flush the privileges to ensure the changes take effect:
FLUSH PRIVILEGES;

You have now created a new database user and database on MySQL or MariaDB.

Oracle

Create a database user and a schema in Oracle

  1. Connect to the Oracle database with a privileged user account (e.g. sys or system).
  2. Create a new user by executing the following command:
CREATE USER username IDENTIFIED BY password;

Replace username and password with your desired values. This command creates a new user account in the Oracle database.

  1. Grant privileges to the new user by executing the following command:
GRANT CONNECT, RESOURCE TO username;

This grants the user permission to connect to the database and create new objects (tables, views, etc.) in their own schema.

  1. Create a new schema by executing the following command:
CREATE SCHEMA schema_name AUTHORIZATION username;

Replace schema_name with the desired name of your schema. This command creates a new schema that is owned by the specified user.

  1. Grant privileges to the user for the new schema by executing the following command:
GRANT ALL PRIVILEGES ON schema_name TO username;

This grants the user full access to the new schema, including the ability to create new objects and modify existing ones.

You now have a new user account and a schema in your Oracle database.

Microsoft SQL Server

Create a database user and a database on Microsoft SQL Server On Windows

  1. Open SQL Server Management Studio (SSMS) and connect to the SQL Server instance you want to create a database user and a database on.
  2. Right-click on the "Security" folder in the Object Explorer pane and select "New" -> "Login".
  3. In the "Login - New" window, enter a name for the new login in the "Login name" field, select the authentication type (e.g., Windows authentication or SQL Server authentication), and set a password if you choose SQL Server authentication.
  4. In the "User Mapping" section of the "Login - New" window, select the database(s) for which you want to grant the new login access and assign the appropriate roles and permissions.
  5. Click "OK" to create the new login.

Now that you have a new login, you can create a new database:

  1. Right-click on the "Databases" folder in the Object Explorer pane and select "New Database".
  2. In the "New Database" window, enter a name for the new database in the "Database name" field.
  3. Optionally, select the file locations for the database data and log files.
  4. Click "OK" to create the new database.

You can now assign the new login (i.e., user) permissions to the new database by right-clicking on the database in the Object Explorer pane and selecting "Properties" -> "Permissions". From there, you can grant or deny the login access to the database, assign roles and permissions, and specify other settings related to security and access control.

Create a database user and a database on Microsoft SQL Server running on Linux

  1. First, make sure that Microsoft SQL Server is installed on your Linux system and is up and running.

  2. Connect to the SQL Server using SQL Server Management Studio (SSMS) or any other client tool of your choice.

  3. To create a new database user, you can use the following T-SQL script:

CREATE LOGIN [username] WITH PASSWORD = 'password';

Replace [username] with the desired username and 'password' with the desired password.

  1. Next, you need to create a user in the database that you want to grant permissions to. You can use the following T-SQL script:
USE [database_name];
CREATE USER [username] FOR LOGIN [username];

Replace [database_name] with the name of the database that you want to create the user in, and [username] with the username that you created in step 3.

  1. Finally, to create a new database, you can use the following T-SQL script:
CREATE DATABASE [database_name];

Replace [database_name] with the desired name of the new database.

You have now created a new database user and a database on Microsoft SQL Server running on Linux.

DocsNG Application Installation

Linux Installation Guide

System requirements
  • .NET Core 7.0+ (for Linux, macOS, Android, iOS, …)
  • Application server preferrably NGINX
Install NGINX with .NET support on Linux

The following example is provided for Ubuntu. For other Linux distributions, please refer to the official Microsoft documentation at https://github.com/dotnet/docs/blob/main/docs/core/install/linux.md.

  1. Update the package manager: First, update the package manager by running the following command in the terminal:

    sudo apt-get update
    

  2. To install ASP.NET Core, the .NET Core runtime, and SDK on your Linux machine, you must first register the Microsoft package repository by using the following command:

    # Get Ubuntu version
    declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
    
    # Download Microsoft signing key and repository
    wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    
    # Install Microsoft signing key and repository
    sudo dpkg -i packages-microsoft-prod.deb
    
    # Clean up
    rm packages-microsoft-prod.deb
    
    # Update packages
    sudo apt update
    
  3. Run the following commands to install the .NET Core runtime and SDK and ASP.NET Core:

        sudo apt-get install -y dotnet-sdk-7.0
    
        sudo apt-get install -y dotnet-runtime-7.0
    
        sudo apt-get install -y aspnetcore-runtime-7.0
    

  4. Install a web server: Install a web server to serve the .NET Core application. In this example, we will use Nginx as the web server. To install Nginx, run the following command:

    sudo apt-get install -y nginx
    

Download and Install DocsNG

Before proceeding to the next step, make sure that you have completed all the necessary preparations for your NGINX application server .NET Core and database.

  1. First, download DocsNG.zip file from https://www.docsng.com.

  2. Extract the contents of DocsNG.zip file to a directory on your Linux machine.

  3. Open the Nginx configuration file (usually located at /etc/nginx/nginx.conf) using your favorite text editor.

  4. Add a new server block for your DocsNG website by copying and pasting the following code into the file:

    server {
        listen 80;
        server_name docsng.example.com; # Replace with your domain name
    
        location / {
            proxy_pass http://localhost:5001;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection keep-alive;
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }
    
    location /content/ {
        alias /path/to/DocsNG/; # Replace with the actual path to the content directory
        }
    }
    

    Make sure to replace "docsng.example.com" with your own domain name and "/path/to/DocsNG/" with the actual path to the content directory.

  5. Save the configuration file

  6. Create the service file Create the service definition file:

    sudo nano /etc/systemd/system/DocsNG.service
    

    The following example is an .ini service file for the app:

    [Unit]
    Description=DocsNG .NET Web API App running on Linux
    
    [Service]
    WorkingDirectory=/path/to/DocsNG
    ExecStart=/usr/bin/dotnet /path/to/DocsNG/DocsNG.dll
    Restart=always
    # Restart service after 10 seconds if the dotnet service crashes:
    RestartSec=10
    KillSignal=SIGINT
    SyslogIdentifier=dotnet-example
    User=www-data
    Environment=ASPNETCORE_ENVIRONMENT=Production
    Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
    
    [Install]
    WantedBy=multi-user.target
    

  7. Save the file and enable the service.

    sudo systemctl enable DocsNG.service
    
    8. Start the service and verify that it's running.

    sudo systemctl start DocsNG.service
    sudo systemctl status DocsNG.service
    DocsNG.service - Example .NET Web API App running on Linux
    Loaded: loaded (/etc/systemd/system/DocsNG.service; enabled)
    Active: active (running) since Thu 2016-10-18 04:09:35 NZDT; 35s ago
    Main PID: 9021 (dotnet)
    CGroup: /system.slice/DocsNG.service
            └─9021 /usr/local/bin/dotnet /path/to/DocsNG/DocsNG.dll
    
Update database settings on DocsNG appsettings.json file
  1. Locate the appsettings.json in the deployment directory of DocsNG. It is located in the root folder of DocsNG.

  2. Open the appsettings.json file in your preferred text editor.

  3. Look for the "ConnectionStrings" section. It should look something like the following:

        "DbProvider": "Postgres",
        "ConnectionStrings": {
            "Sqlite": "Data Source=nextdoc.db",
            "Postgres": "Host=localhost;Database=mydatabase;Username=myuser;Password=mypassword",
            "Mssql": "Server=(localdb)\\mssqllocaldb;Database=mydatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
            "Mysql": "Server=localhost;Database=mydatabase;User=myuser;Password=mypassword;TreatTinyAsBoolean=true"
            "Oracle": "DefaultConnection": "User Id=myuser;Password=mypassword;Data Source=mydatasource"
        }
    
  4. Modify the connection string according to your database settings. For example, if you are using SQL Server and want to connect to a different server and database, you can modify it like this

    Note that these default connection strings assume that the database is running on the same machine as the web application. If your database is running on a different machine, you will need to modify the connection string accordingly by specifying the hostname or IP address of the database server. Additionally, you will need to replace "mydatabase", "myuser", "mypassword", and "mydatasource" with the actual values for your database.

  5. Locate "DbProvider" field and change the to your database as Sqlite, Postgres, Mssql, Mysql, or Oracle as your database.

  6. Save the changes to the appsettings.json file.

  7. Restart Nginx using the following command:

    sudo systemctl restart nginx
    
  8. Navigate to your DocsNG website in your web browser to make sure it's working properly.

DocsNG should now be up and running on Nginx.

Windows Installation Guide

System requirements
  • .NET Core 7+
  • .NET Core 7+ Hosting Bundle
  • IIS server
Install .NET Core 7+ on Windows
  1. Open a web browser and go to the official .NET Core download page at https://dotnet.microsoft.com/download/dotnet/7.0.

  2. Under the ".NET Core 7.0 SDK" section, click the download link for the appropriate version of Windows you are running (x64 or x86).

  3. Once the download is complete, run the installer by double-clicking the downloaded file.

  4. In the installer, select the desired installation location and click "Install".

  5. Wait for the installation to complete. This may take several minutes.

  6. Once the installation is complete, open a command prompt or PowerShell window and enter the command "dotnet --version" to verify that .NET Core 7 is installed correctly.

You have successfully installed .NET Core 7 on your Windows machine.

Install .NET Core 7+ Hosting Bundle on Windows
  1. Open your web browser and go to the .NET Core website: https://dotnet.microsoft.com/download/dotnet-core

  2. Scroll down to the ".NET Core 7.x" section and click on the "Download .NET Core Runtime" button.

  3. On the next page, select the appropriate hosting bundle for your Windows server architecture (x86 or x64) and click on the "Download" button.

  4. Once the download is complete, navigate to the downloaded file and double-click it to start the installation process.

  5. The installer will display the license terms, read and accept the terms to continue with the installation.

  6. Choose the installation location for the .NET Core 7 Hosting Bundle. By default, it will be installed in the "Program Files" folder. You can change the location if required.

  7. Click on the "Install" button to start the installation process.

  8. The installer will download and install the necessary components required to run .NET Core 7 Hosting Bundle.

  9. Once the installation is complete, the installer will prompt you to restart your computer. Click on the "Finish" button to complete the installation.

  10. After restarting your computer, you can verify that the .NET Core 7 Hosting Bundle is installed by opening a command prompt and typing "dotnet --info" to see the version and other details of .NET Core installed on your system.

You have successfully installed .NET Core 7 Hosting Bundle on your Windows server.

Install IIS on Windows Server

Follow the following steps to install IIS (Internet Information Services) on a Windows Server:

  1. Open the Server Manager: Open the Start menu, type in "Server Manager" and select it from the results.
  2. Add Roles and Features: In the Server Manager, select "Add Roles and Features" from the Dashboard or the Manage menu.
  3. Role-based or feature-based installation: In the "Add Roles and Features Wizard", select "Role-based or feature-based installation" and click "Next".
  4. Select the target server: Choose the server on which you want to install IIS and click "Next".
  5. Select the server roles: Select "Web Server (IIS)" from the list of roles and click "Next".
  6. Select the features: In the "Select features" section, you can choose additional features to install along with IIS. You can also skip this step and click "Next".
  7. Web server role (IIS): Read the information about the Web Server role and click "Next".
  8. Features: Read the information about the selected features and click "Next".
  9. Role services: In the "Select role services" section, you can choose the specific IIS components to install. By default, all the necessary components are selected for you. Click "Next".
  10. Confirmation: Review the installation selections and click "Install".
  11. Installation progress: Wait for the installation process to complete.
  12. Results: Once the installation is complete, you should see a "Results" page. Verify that the installation completed successfully and click "Close".

IIS should now be installed on your Windows Server. You can access it by typing "inetmgr" in the Start menu and selecting Internet Information Services (IIS) Manager.

Downloading and installing DocsNG

Before proceeding to the next step, make sure that you have completed all the necessary preparations for your application server and database.

We will deploy DocsNG on a new website on IIS using the binaries in DocsNG.zip file you downloaded from https://www.docsng.com:

  1. First, extract the contents of DocsNG.zip to a folder on your local machine.

  2. Open the Internet Information Services (IIS) Manager by clicking on the Start menu and typing "IIS" in the search box. Select "Internet Information Services (IIS) Manager" from the search results.

  3. In the left-hand pane of the IIS Manager, expand the "Sites" folder and select the site to which you want to deploy the new website.

  4. Right-click on the site and select "Add Website" from the context menu.

  5. In the "Add Website" dialog box, enter a name for the new website in the "Site name" field, for example "DocsNG".

  6. In the "Physical path" field, browse to the folder where you extracted the contents of DocsNG.zip.

  7. In the "Binding" section, select the appropriate IP address, port, and hostname for the new website. If you're not sure which IP address or port to use, you can leave these fields set to their defaults.

  8. Under "Application pool", select "DefaultAppPool" if you want to use the default application pool, or select a different application pool if you have already created one for the new website.

  9. Click "OK" to create the new website.

  10. In the left-hand pane of the IIS Manager, select the new website.

  11. In the right-hand pane, click on "Browse *:80 (http)" to open the new website in your default web browser.

Update database settings on DocsNG appsettings.json file
  1. Locate the appsettings.json in the deployment directory of DocsNG. It is located in the root folder of DocsNG.

  2. Open the appsettings.json file in your preferred text editor.

  3. Look for the "ConnectionStrings" section. It should look something like the following:

        "DbProvider": "Postgres",
        "ConnectionStrings": {
            "Sqlite": "Data Source=nextdoc.db",
            "Postgres": "Host=localhost;Database=mydatabase;Username=myuser;Password=mypassword",
            "Mssql": "Server=(localdb)\\mssqllocaldb;Database=mydatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
            "Mysql": "Server=localhost;Database=mydatabase;User=myuser;Password=mypassword;TreatTinyAsBoolean=true"
            "Oracle": "DefaultConnection": "User Id=myuser;Password=mypassword;Data Source=mydatasource"
        }
    
  4. Modify the connection string according to your database settings. For example, if you are using SQL Server and want to connect to a different server and database, you can modify it like this

    Note that these default connection strings assume that the database is running on the same machine as the web application. If your database is running on a different machine, you will need to modify the connection string accordingly by specifying the hostname or IP address of the database server. Additionally, you will need to replace "mydatabase", "myuser", "mypassword", and "mydatasource" with the actual values for your database.

  5. Locate "DbProvider" field and change the to your database as Sqlite, Postgres, Mssql, Mysql, or Oracle as your database.

  6. Save the changes to the appsettings.json file.

  7. Navigate to your DocsNG website in your web browser to make sure it's working properly.

You have successfully deployed a DocsNG on IIS!

Installing DocsNG Using Docker Compose

DocsNG provides an easy way to deploy its services within a Docker container using Docker Compose. This method streamlines the setup process and allows you to specify your desired credentials for the PostgreSQL database. Follow these steps to get DocsNG up and running:

Prerequisites

Before you start, ensure you have the following prerequisites in place:

  • Docker: Make sure you have Docker installed on your system.
  • Docker Compose: Ensure you have Docker Compose installed. If it's not installed, you can find installation instructions here.

Step 1: Create the Docker Compose File

To Install DocsNG using Docker Compose, you'll need to create a docker-compose.yml file. Follow these steps to generate the Compose configuration:

  1. Open your preferred text editor.

  2. Copy and paste the code snippet provided below into the text editor to create a docker-compose.yml file:

version: '3.7'
services:
    web:
        container_name: 'docsng'
        image: 'nextarp/docsng'
        environment:
            # change below part for production deployment
            DB_CONNECTIONSTRING: "host=postgres;port=5432;database=docsng;username=docsng;password=ComplexDocsNGPass"
            DB_PROVIDER: "Postgres"
        ports:
            - "5001:5001"
            - "5002:5002"
        depends_on:
            - "postgres"
        networks:
            - docsng-network

    postgres:
        container_name: 'postgres'
        image: postgres
        environment:
            # change below part for production deployment
            POSTGRES_DB: "docsng"
            POSTGRES_USER: "docsng"
            POSTGRES_PASSWORD: "ComplexDocsNGPass"
        restart: always
        ports:
            - "10000:5432"
        networks:
            - docsng-network
        volumes:
            - postgres_data:/var/lib/postgresql/data

networks:
    docsng-network:
    driver: bridge

volumes: 
    postgres_data:

Step 2: Configure the Compose File

You will need to configure the PostgreSQL environment variables to set your desired credentials for the database server. Locate the environment variables section and make the following updates:

  • POSTGRES_DB: Set the name of your PostgreSQL database.
  • POSTGRES_USER: Specify the username for your database.
  • POSTGRES_PASSWORD: Choose a strong password for your database user.
  • DB_CONNECTIONSTRING: Modify the connection string by using the values you've set for POSTGRES_DB, POSTGRES_USER, and POSTGRES_PASSWORD.

Step 3: Deploy DocsNG

With the Compose file configured, it's time to deploy DocsNG. Open your terminal, navigate to the directory where the Docker Compose file is located, and run the following command:

docker-compose up

This command will download the DocsNG and PostgreSQL images, create containers, and start the services.

That's it! You have successfully installed DocsNG using Docker Compose. You can now begin using DocsNG for document management and generation.

This guide covers the installation of DocsNG using Docker Compose, emphasizing the configuration of the PostgreSQL database credentials to get you started with DocsNG. Please adapt it to your specific needs and provide any additional details or instructions as required.

Post-Installation Steps

Running DocsNG for the first time

Access the DocsNG Web Interface

Once the deployment is complete, you can access the DocsNG web interface using your web browser. Enter the following URL:

  • https://[Server's IP Address or Domain]:5002 : By default, DocsNG installs a self-signed TLS certificate. However, if you prefer to use a different certificate, you can easily upload a password-free PFX (Personal Information Exchange) file. This can be done through the "Settings" menu, under the "Server Settings" sub-menu.
  • http://[Server's IP Address or Domain]:5001 : if you need to use DocsNG behind of a firewall and prefer to use TLS offloading (or any other security device) of the firewall you can simply use HTTP protocol.

Never use DocsNG in a production environment without TLS (Transport Layer Security).

You will be greeted with the DocsNG login page. Below are default admin credentials:

  • Admin Username: admin
  • Admin Password: !DocsNGAdmin12

Dont forget to change default password.

Initialize & License DocsNG

Upon your first login, you need to go to Settings mennu and Server Settings sub menu to enter your licensing information.

Following are the steps for entering DocsNG licensing keys:

Entering Licensing Keys

  1. Log in to DocsNG with an administrator role.
  2. Go to the "Settings" menu.
  3. Select the "Server Settings" sub-menu.
  4. Navigate to the "Licensing" section.
  5. In the Licensing section, you will find fields to enter the three required keys: Key A, Key B, and Key C.
  6. Carefully enter the provided licensing keys in the respective fields.
  7. Double-check the keys to ensure accuracy.
  8. Click the "Save" button to apply the licensing keys.
  9. Restart the DocsNG application.

The specific steps to restart the application might vary depending on your application server and hosting environment. Ensure that you follow the appropriate procedures for your setup to ensure a smooth restart of DocsNG.

Ensure that all three keys (Key A, Key B, and Key C) are correctly entered for DocsNG to function correctly.

By following these steps, you will successfully enter the licensing keys required for DocsNG.

Creating Additional Users in DocsNG

  1. Log in to DocsNG with an Administrator account.
  2. Navigate to the "Settings" menu.
  3. Select the "Users" submenu.
  4. Click the "+" button to open the user creation screen.
  5. Fill in the following information for the new user:

    • Username
    • Name
    • Surname
    • Email
    • Role (Choose either "User" or "Administrator")
    • User Interface Language
  6. Click the "Save" button to create the user.

  7. Once the user is created, you can set their password, and they will be able to access DocsNG with their credentials.

For document generation from the GUI or API, as well as signing and encryption, the normal user role is sufficient.

Configuring Advanced PDF Permissions

DocsNG allows you to set up advanced PDF permissions to control what users can do with generated PDF documents. Follow these steps to configure this feature:

  1. Login as Administrator: Ensure you have administrator access to DocsNG.
  2. Access the Server Settings:

    • Log in to the DocsNG application.
    • Go to the "Settings" menu.
  3. Navigate to PDF Permissions Configuration:

    • In the "Settings" menu, find and click on "Server Settings."
  4. Configure PDF Permissions:

    • In the "Server Settings" section, locate the PDF Permissions Configuration.
    • Enter the following information:

      • PDF Permission Password: Set a secure password that will be required to perform actions that are not allowed without it.
      • List of PDF Permissions without Password: Here, specify a list of PDF permissions that users can perform without needing the password. For example, if you want users to be able to print documents without a password, include "Print" in this list. Here are the available permissions that can be granted:

        • Print
        • Change Content
        • Copy Content
        • Comment and Fill Form
        • Fill Form
        • Copy Content for Accesibility
        • Assemble Document
        • Print High Resolution
  5. Save Changes:

    • After entering the required information, click the "Save" button to save your PDF permission settings.

Now, DocsNG is configured to apply the specified PDF permissions to all PDF document generation. Users will be required to enter the PDF permission password for actions not allowed without it, according to your configuration. This helps you control and secure the usage of generated PDF documents.

Configuring Visibility, Size and Position of Digital Signatures

To configure the location and size of digital signatures, follow these steps after installation:

  1. Log in to DocsNG with administrator credentials.
  2. In the top menu, click on "Settings."
  3. In the dropdown menu, select "Server Settings."
  4. Click "Show Digital Signatures" check box.
  5. To configure the location and size of the digital signature, locate the following settings:

    • "Signature Left Position": This setting determines the position from the left side of the first page of the document.
    • "Signature Bottom Position": This setting specifies the position from the bottom of the first page.
    • "Signature Width": Set the width of the signature field.
    • "Signature Height": Set the height of the signature field.
  6. Enter the desired values for these settings to define the location and size of the digital signature.

  7. After configuring the settings to your preferences, remember to save the changes if needed.

By setting these parameters, you can control the exact position and dimensions of the digital signature on the first page of your output PDF documents. This provides you with flexibility in customizing the appearance of digital signatures to meet your specific requirements.

Setup Timestamp Server URL for PAdES LTV Digital Signatures

To set up the Timestamp Server URL for PAdES LTV standard in DocsNG, follow these steps:

  1. Log in to DocsNG using your administrator credentials.
  2. Click on the "Settings" menu in the top navigation bar.
  3. In the dropdown menu, select "Server Settings."
  4. Within the Server Settings, navigate to the "Timestamp Server".
  5. Enter the URL of your preferred Timestamp Server in this field. Ensure that the URL is correct and accessible. You may use a public timestamp server or a commercial one, depending on your needs.
  6. Save your changes.

Timestamping is essential for ensuring the long-term validity of digital signatures. By setting up the Timestamp Server URL, you enable DocsNG to include trusted timestamps in your digitally signed documents, enhancing their integrity and legal validity.

Install Windows fonts on a Linux or Docker Image

DocsNG mandates the presence of fonts used in templates on its host system. Typically, Microsoft Windows fonts aren't accessible on Linux machines or Linux-based Docker images by default. You can facilitate the installation of Microsoft Windows fonts on your DocsNG host either automatically or through manual procedures. By following below steps, you should be able to install Windows fonts on your Linux machine. Keep in mind that not all Windows fonts may be freely distributable, so make sure you have the right to use them on your Linux system.

Manual Installation of Microsoft Windows Fonts

If DocsNG is installed within a Docker container, you should first access the container's Bash. In the example below, replace <mycontainer> with the DocsNG hostname, typically 'docsng'.

docker exec -it <mycontainer> bash
  • Create a Directory: Open a terminal and create a directory where you'll store the Windows fonts.

    sudo mkdir /usr/share/fonts/windows
    

  • Copy Fonts : Copy the TrueType Font (TTF) files from a Windows machine to the directory you created on your Linux machine. You can use a USB drive or a shared network location to transfer the font files.

  • Update Font Cache: After copying the font files, update the font cache so that Linux recognizes the new fonts. Run the following command:

    sudo fc-cache -f -v
    

  • Check Installed Fonts: You can check if the fonts are installed by running:

    fc-list
    
    This command will display a list of all installed fonts.

  • Restart DocsNG: DocsNG require application restart to use the newly installed fonts.

Automated Installation of Microsoft Windows Fonts

If DocsNG is installed within a Docker container, you should first access the container's Bash. In the example below, replace <mycontainer> with the DocsNG hostname, typically 'docsng'. Usually sudo is not required to execute bash commands for Docker Container. Depending on your host some font repositories might not be available.

docker exec -it <mycontainer> bash
  • Update the host : First execute general system uupdate using the following command.
    sudo apt update
    
  • Install using ttf-mscorefonts-installer :

    sudo apt install ttf-mscorefonts-installer
    

  • Install using fontforge :

    sudo apt install fontforge
    

  • Install using cabextract :

    sudo apt install cabextract
    

  • Update Font Cache :

    sudo fc-cache -f -v
    

  • Check Font Cache :

    sudo fc-list
    

  • Restart DocsNG : DocsNG require application restart to use the newly installed fonts.