Uninstalling Allegra#

This chapter describes how to uninstall Allegra from Ubuntu and other Linux systems.

Attention

Before uninstalling, ensure you have backups of:

  • Your complete database

  • Your ALLEGRA_HOME directory (contains all attachments, templates, and configuration)

Uninstalling the Systemd Service#

If Allegra is installed as a systemd service, you must remove it first:

  1. Stop the Allegra service:

    sudo systemctl stop allegra
    
  2. Remove the service:

    cd /home/ubuntu/allegra
    sudo ./allegra.sh uninstall-service
    

    Or manually remove the service file:

    sudo systemctl disable allegra
    sudo rm /etc/systemd/system/allegra.service
    sudo systemctl daemon-reload
    
  3. Verify service removal:

    sudo systemctl status allegra
    

    You should see “Unit allegra.service could not be found.”

Deleting the Application#

After removing the service (if installed), delete the Allegra installation:

  1. Stop Allegra (if running without service):

    cd /home/ubuntu/allegra
    ./allegra.sh stop
    
  2. Delete the installation directory:

    rm -rf /home/ubuntu/allegra
    

    This removes the Allegra application, scripts, and configuration.

  3. Delete ALLEGRA_HOME directory (optional):

    If you want to completely remove all data, delete the ALLEGRA_HOME directory:

    rm -rf /home/ubuntu/allegra/allegra-home
    

    Warning

    This permanently deletes all attachments, templates, and uploaded files. Only do this if you’re certain you don’t need the data.

  4. Remove database (optional):

    If you want to remove the Allegra database, use your database management tools:

    PostgreSQL:

    sudo -u postgres dropdb allegra
    

    MySQL:

    mysql -u root -p
    DROP DATABASE allegra;
    

    Warning

    This permanently deletes all Allegra data. Only do this if you’re certain you don’t need the data.

Clean Up (Optional)#

If desired, you can also remove:

  • Java installation (if only used for Allegra)

    sudo apt remove openjdk-21-jdk
    
  • Database server (if only used for Allegra)

    # PostgreSQL
    sudo apt remove postgresql postgresql-contrib
    
    # MySQL
    sudo apt remove mysql-server
    
  • Any firewall rules created for Allegra

    sudo ufw status numbered
    # Note the rule number for port 8080, then:
    sudo ufw delete <rule-number>
    
  • Dedicated allegra user (if created)

    sudo userdel -r allegra
    

That’s it! Allegra is now completely uninstalled from your Ubuntu system.