How to Install wger on FreeBSD Latest

wger is a free, open-source web application for tracking fitness activities and workouts. In this tutorial, we will be going through the steps required to install wgar on a FreeBSD Latest machine.

Step 1: Install Required Packages

Before we can install wger, we need to install some required packages. Open a terminal shell and run the following command:

$ sudo pkg install python3.7 py37-pip postgresql12-server postgresql12-client

This command will install Python3, pip, PostgreSQL server and client on your FreeBSD machine.

Step 2: Create a PostgreSQL Database

Before we can use wger, we need to create a PostgreSQL database for it to use. Open a terminal shell and run the following commands:

$ sudo service postgresql onestart
$ sudo su - postgres
$ createdb wgerdb

Step 3: Install wger

We will now install wger using pip3. Run the following command in the terminal shell:

$ sudo pip3 install wger

Step 4: Configure wger

Create a configuration file named wger.conf in /usr/local/etc/ directory with the following content:

[flask]
SECRET_KEY = YourSecretKeyHere
SQLALCHEMY_DATABASE_URI = postgresql://postgres@localhost/wgerdb
WGER_MAIL_SERVER = smtp.gmail.com
WGER_MAIL_USE_TLS = True
WGER_MAIL_PORT = 587
WGER_MAIL_USERNAME = yourgmailusername@gmail.com
WGER_MAIL_PASSWORD = yourgmailpassword

[oauth]
GOOGLE_CLIENT_ID = YourGoogleClientIdHere
GOOGLE_CLIENT_SECRET = YourGoogleClientSecretHere

Replace the YourSecretKeyHere, localhost and yourgmailusername@gmail.com, yourgmailpassword with appropriate values, and add YourGoogleClientIdHere and YourGoogleClientSecretHere if you want to enable Google authentication.

Now, initialize your database with the following command:

$ wger db create

Step 5: Run wger

Now that wger is installed and configured, we can run it using the following command:

$ wger run

By default, wger runs on port 5000. You can now access the wger web interface by opening a web browser and navigating to http://localhost:5000/.

Congratulations, you have successfully installed and configured wger on your FreeBSD Latest machine!

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!