Installing wger on Void Linux

wger is a free, open-source personal fitness tracking application that allows users to create and achieve their fitness goals by tracking different exercises, meals, and measurements. In this tutorial, we will guide you on how to install wger on Void Linux.

Prerequisites

Step 1: Update your system

Before installing any package, it is a good idea to update your system to make sure you have the latest packages and security updates. You can do this by running the following command:

sudo xbps-install -Suv

This will update the package list and software dependencies.

Step 2: Install the required packages

To install wger, you need to install some packages first. Run the following command to install the necessary packages:

sudo xbps-install -y postgresql postgresql-client postgresql-contrib openldap openldap-client uwsgi uwsgi-plugin-python3 git

This command installs PostgreSQL, OpenLDAP, uWSGI, and Git.

Step 3: Create a PostgreSQL database for wger

wger uses PostgreSQL as its database engine. Therefore, you need to create a PostgreSQL database for wger. To do this, log in to the PostgreSQL server:

sudo -u postgres psql

Then, create a new database, a new user, and grant necessary privileges:

CREATE DATABASE wger;
CREATE USER wgeruser WITH PASSWORD 'wgerpassword';
GRANT ALL PRIVILEGES ON DATABASE wger TO wgeruser;

Now you have a new database for wger.

Step 4: Clone wger from GitHub

To get the latest version of wger, you need to clone it from GitHub. Run the following command to clone the repository:

git clone https://github.com/wger-project/wger.git

This will create a new directory called wger that contains the wger source code.

Step 5: Install wger dependencies

There are some dependencies you need to install before installing wger. You can install these dependencies using pip, the Python package manager:

sudo pip3 install -r requirements.txt

This command installs all the dependencies that wger needs to run.

Step 6: Edit the wger settings file

Before running wger, you need to edit the settings.py file to set up the connection to the PostgreSQL database you created earlier. Open the settings.py file in a text editor:

nano wger/settings.py

Then, look for the following lines:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

Change these lines to:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'wger',
        'USER': 'wgeruser',
        'PASSWORD': 'wgerpassword',
        'HOST': 'localhost',
        'PORT': '',
    }
}

Save and exit the file.

Step 7: Run wger

You are now ready to run wger. To start the development server, change to the wger directory and run the following command:

./manage.py runserver

You can now access wger by opening a web browser and navigating to http://localhost:8000. If you are running wger on a remote server, replace localhost with the server's IP address or hostname.

Conclusion

In this tutorial, you learned how to install wger on Void Linux. If you follow these steps carefully, you should now have a working installation of wger that you can use to track your fitness goals.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!