Skip to content

Installing Your CodeLogic Server on Ubuntu

You must ensure that your system meets the specifications outlined in the CodeLogic Installation Requirements.

Note

Internet access is only needed for installation and upgrading. Once installed, the CodeLogic Server is the package repository for the Linux and Windows agents.

All sample output is for reference only, it may differ on your system.

An ellipsis (…) indicates omitted output.

Before You Begin

If you do not have internet access, see Commands for the command to list the dependencies for the CodeLogic Server. You will need to have the listed dependencies installed before installing CodeLogic.

  • Install the CodeLogic Key

    sudo wget -O /usr/share/keyrings/codelogic-archive.key  http://repo.codelogic.com/debian/archive.key
    

    Sample Output
    # sudo wget -O /usr/share/keyrings/codelogic-archive.key  http://repo.codelogic.com/debian/archive.key
    --2024-12-16 16:15:11--  http://repo.codelogic.com/debian/archive.key
    Resolving repo.codelogic.com (repo.codelogic.com)... 52.219.141.8, 52.219.96.43, 3.5.129.152, ...
    Connecting to repo.codelogic.com (repo.codelogic.com)|52.219.141.8|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 3130 (3.1K) [application/x-iwork-keynote-sffkey]
    Saving to: ‘/usr/share/keyrings/codelogic-archive.key’
    
    /usr/share/keyrings/codelogic-archive.key          100%[================================================================================================================>]   3.06K  --.-KB/s    in 0s
    
    2024-12-16 16:15:11 (494 MB/s) - ‘/usr/share/keyrings/codelogic-archive.key’ saved [3130/3130]
    
  • Add the CodeLogic Repository to the Package Database

    Create the /etc/apt/sources.list.d/codelogic.sources file to add the CodeLogic repository to your sources.list by copying the lines below.

    codelogic.sources
    sudo sh -c 'cat << EOF > /etc/apt/sources.list.d/codelogic.sources
    Types: deb 
    URIs: http://repo.codelogic.com/debian/
    Suites: stable
    Components: main
    Signed-By: /usr/share/keyrings/codelogic-archive.key
    EOF'
    
  • Update the repo database

    sudo apt update
    
    Sample Output
    # sudo apt update
    Hit:1 http://staging.codelogic.com/debian stable InRelease
    Hit:2 http://us.archive.ubuntu.com/ubuntu noble InRelease                                      
    Hit:3 http://us.archive.ubuntu.com/ubuntu noble-updates InRelease  
    …
    Fetched 3,108 kB in 1s (2,370 kB/s)  
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    
  • Install the CodeLogic Server

    sudo apt-get install --assume-yes -f codelogic
    

    Sample Output
    # sudo apt-get install --assume-yes -f codelogic
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following additional packages will be installed:
    dpkg-awk net-tools pbzip2
    Suggested packages:
    dctrl-tools
    The following NEW packages will be installed:
    codelogic dpkg-awk net-tools pbzip2
    0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
    Need to get 4,691 MB of archives.
    After this operation, 4,701 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Get:1 http://us.archive.ubuntu.com/ubuntu noble/universe amd64 dpkg-awk all 1.2+nmu2 [8,696 B]
    Get:2 http://us.archive.ubuntu.com/ubuntu noble/main amd64 net-tools amd64 2.10-0.1ubuntu4 [204 kB]
    Get:3 http://repo.codelogic.com/debian  codelogic 24.14.3 [4,691 MB]
    Get:4 http://us.archive.ubuntu.com/ubuntu noble/universe amd64 pbzip2 amd64 1.1.13-1build1 [40.0 kB]
    Fetched 4,691 MB in 9min 42s (8,062 kB/s)
    …
    Loaded image: 130246223486.dkr.ecr.us-east-2.amazonaws.com/neo4j:4.4.21-enterprise
    Created symlink /etc/systemd/system/multi-user.target.wants/codelogic-storage-check.service → /usr/lib/systemd/system/codelogic-storage-check.service.
    Created symlink /etc/systemd/system/codelogic.service.wants/codelogic-storage-check.timer → /usr/lib/systemd/system/codelogic-storage-check.timer.
    codelogic.service is enabled but not started, configuration is needed.
    Please execute 'sudo /opt/codelogic/pre_start_codelogic.sh' to configure and start the CodeLogic Server now.
    After the CodeLogic Server is started, install or upgrade the agents on systems that will be analyzed.
    Processing triggers for man-db (2.12.0-4build2) ...
    
  • Run the Configure Script

    • Run the following command:
      sudo /opt/codelogic/pre_start_codelogic.sh
      
      The script will confirm the protocol (http or https), hostname or IP address, and create a self-signed certificate for testing purposes.
    • If a signed certificate is available now, answer N to the Allow HTTP? question.

    Note

    A self-signed certificate will be created regardless of the answer. The answer to this question determines the protocol (http or https) used for the software repository.

    For example, if http://myserver.com is entered, the package repositories will use http. If https://myserver.com is entered, the package repositories will use https.

    See Install a signed TLS certificate on the server below for more information.

    • Create a CodeLogic Administrator Account with an email address and password.

    Note

    The password must be between 8 and 256 characters in length (numbers, symbols, and mixed-case letters allowed).

  • Install a signed TLS certificate on the server

    • The signed TLS certificate and key file names must be named codelogic.crt and codelogic.key.
    • Copy the signed TLS certificate and key to /opt/codelogic/certs/ and restart the CodeLogic Server.

    Important

    The certificate must be signed by a certificate authority. Although a self-signed certificate allows access to the GUI, the agents will not accept a self-signed certificate. For more information, see Using Internally Generated Certificates.

    The self-signed certificate created by pre_start_codelogic.sh may be used for product evaluation.

    sudo cp -p /path/to/signed/certificate.crt /opt/codelogic/certs/codelogic.crt
    sudo cp -p /path/to/signed/certificate.key /opt/codelogic/certs/codelogic.key
    sudo cp /path/to/your/root-or-intermediate-cert.crt /opt/codelogic/root_certs
    sudo systemctl restart codelogic
    
    • Verify that the CodeLogic Server is Running
    • The server is controlled via standard Linux facilities. For example, to view the status, use the systemctl command. Root permission is not needed to view the status.
      systemctl status codelogic
      
    Sample Output
    $ systemctl status codelogic
    ● codelogic.service - CodeLogic
    Loaded: loaded (/lib/systemd/system/codelogic.service; enabled; vendor preset: enabled)
    Active: active (exited) since Fri 2021-01-08 15:45:35 PST; 5h 25min ago
    Docs: https://www.codelogic.com
    https://info.codelogic.com/blog
    Main PID: 1554 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 19150)
    Memory: 0B
    CGroup: /system.slice/codelogic.service
    
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: Starting postgres ...
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: nginx is up-to-date
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: codelogic_autoheal_1 is up-to-date
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: mongodb is up-to-date
    Jan 08 15:46:01 ub20scratch docker-compose[1554]: Starting neo4j...
    Jan 08 15:46:06 ub20scratch docker-compose[1554]: [69B blob data]
    Jan 08 15:46:08 ub20scratch docker-compose[1554]: [77B blob data]
    Jan 08 15:46:09 ub20scratch docker-compose[1554]: [77B blob data]
    Jan 08 15:46:14 ub20scratch docker-compose[1554]: [125B blob data]
    Jan 08 15:46:18 ub20scratch docker-compose[1554]: [48B blob data]
    
    • Log in to the Server
    • Log in to the CodeLogic Server with the CodeLogic Administrator Account you created above.
    • If a signed TLS certificate has been copied to /opt/codelogic/certs, use https to log in the server using the default credentials.
    • If “y” was the response to the “Allow HTTP?” question, use http.
      URL (https): https://your_server/
      URL (http):http://your_server/
      Email:<email address>
      Password:<password>
      

    Note

    You MUST replace your_server with the actual address of your CodeLogic Server.

    Note

    It may take 2-3 minutes after restarting CodeLogic before login is available.


Up Next: Agent Scanning