Localhost logviewer
Here you will find how to localhost logviewer.
System requirements
Ubuntu 20.04-22.04 is required for this tutorial.
Download logviewer
The first step is to download logviewer. This simply can be done using the following command
git clone https://github.com/modmail-dev/logviewer logviewerInstall depencies to logviewer
The next thing we will need to do is to install the pipenv depencies to logviewer
First we will head into the logviewer folder by doing
cd logviewerOnce we are in the logviewer folder we will install the depencies by doing the following command
sudo pipenv installonce it is installed successfully it will say this in your terminal

Configuring the .env
We will now head over and start configuring our .env
We will start by doing
nano .envThere you will make sure the following is inside of the .env
MONGO_URI=mongodb+srv://urihere
URL_PREFIX=/logs
HOST=0.0.0.0
PORT=80
Now we will edit the contents of your .env
a example mongo_uri would bemongodb+srv://Papiersnipper:[email protected]/
Your URL_PREFIX should be /logs so
URL_PREFIX=/logs
your HOST has to be 0.0.0.0 unless you know what your doing. So it will be
HOST=0.0.0.0
Your PORT would be the port you want to useto run your webapp on. Stick with 80 if you have no other webapps running on your system.
if you do have other webapp running change the port to something like 7777 and make a nginx configuration see
final .env
your final .env would like like this
MONGO_URI=mongodb+srv://Papiersnipper:[email protected]/
URL_PREFIX=/logs
HOST=0.0.0.0
PORT=80
to save your file you will do the following
- ctrl+x + Y + enter
Starting your logviewer
Now to start your logviewer you will have to run the following command
sudo pipenv run python3 app.pynow your logviewer should be running at
http://0.0.0.0
Optionally you can start your logviewer using pm2 to have it running 24/7 first install pm2
sudo apt install npm -y && sudo npm i pm2 -gOnce pm2 is installed you can do
sudo pm2 start logviewer.sh --name "logviewer" && sudo pm2 saveLast updated
Was this helpful?