/ html / wiki / tutorials / filebrowser / filebrowser.html
filebrowser.html
  1  <!DOCTYPE html>
  2  <html lang="en">
  3     <head>
  4        <meta charset="UTF-8" />
  5        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6        <meta http-equiv="onion-location" content="http://bopbopl6lohkl2rts3ltesjnag4hzs4jrx2h6k6etgq5xasbpqekzlqd.onion" />
  7        <title>BOP Wiki: FileBrowser Installation</title>
  8        <link rel="stylesheet" href="/assets/stylesheet.css" />
  9        <link rel="icon" type="image/x-icon" href="/assets/img/favicon.png">
 10     </head>
 11     <body>
 12        <header>
 13           <!-- --------------------------------------------------------------------------------------------------------------------------------- -->
 14           <script src="/assets/js/navbar-OpenClose.js"></script>
 15           <script src="/assets/js/lightbox.js"></script>
 16            <script src="/assets/js/copyCodeButton.js"></script>
 17           <link rel="stylesheet" href="/resources/js-libraries/highlightJS/atom-one-dark.min.css">
 18           <script src="/resources/js-libraries/highlightJS/highlight.min.js"></script>
 19           <script src="/resources/js-libraries/highlightJS/highlightjs-line-numbers.min.js"></script>
 20           <script>hljs.highlightAll();</script>
 21           <script>hljs.initLineNumbersOnLoad();</script>
 22           <!-- --------------------------------------------------------------------------------------------------------------------------------- -->
 23           <div class="branding">
 24              <button class="toggle-btn-navbar" id="navbarOpenButton">☰</button>
 25              <a href="/">
 26              <img class="logo" src="/assets/img/logo.png">
 27              </a>
 28              <div class="typing-animation">BytesOfProgress</div>
 29           </div>
 30        </header>
 31        <div id="navbarContainer" class="navbar-container">
 32           <iframe class="navbar-iframe" src="/assets/navbar/navbar.html" frameBorder= "0"></iframe>
 33        </div>
 34        <main>
 35           <article class="blog-post">
 36              <header class="post-header">
 37                 <h1 class="post-title">FileBrowser Installation</h1>
 38              </header>
 39           </article>
 40           <nav class="breadcrumb">
 41              <a href="/">Home</a>
 42              <span class="divider">›</span>
 43              <a href="/wiki/">Wiki</a>
 44              <span class="divider">›</span>
 45              <a href="/wiki/tutorials/tutorials.html">Tutorials</a>
 46              <span class="divider">›</span>
 47              <span class="current">FileBrowser Installation</span>
 48           </nav>
 49           <section class="post-content">
 50              <p>
 51                 This works on Debian and Debian-based distributions.
 52              </p>
 53              <ol>
 54                 <li>
 55                    <p>Create a configuration file named <strong>filebrowser.json</strong>. Here you specify the IP address, port, and directory:</p>
 56                    <div class="code-box">
 57                       <pre><code>{
 58            "port": 8080,
 59            "baseURL": "",
 60            "address": "000.000.000.000",
 61            "log": "stdout",
 62            "database": "/etc/filebrowser.db",
 63            "root": "/var/www"
 64  }</code></pre>
 65                    </div>
 66                 </li>
 67                 <li>
 68                    <p>Create a systemd service file named <strong>filebrowser.service</strong>. This ensures Filebrowser starts automatically on server boot or restart:</p>
 69                    <div class="code-box">
 70                       <pre><code>[Unit]
 71  Description=File Browser
 72  After=network.target
 73  
 74  [Service]
 75  ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser.json
 76  
 77  [Install]
 78  WantedBy=multi-user.target</code></pre>
 79                    </div>
 80                 </li>
 81                 <li>
 82                    <p>Create a shell script (e.g. <strong>example.sh</strong>) in the same directory as the other two files and insert the following content:</p>
 83                    <div class="code-box">
 84                       <pre><code>#!/bin/bash
 85  
 86  echo "This script will automatically install Filebrowser!"
 87  sleep 1
 88  echo "Updating package sources..."
 89  sleep 0.5
 90  
 91  apt update &amp;&amp; apt full-upgrade -y &amp;&amp; apt install curl -y
 92  sleep 1
 93  
 94  echo "Updates complete."
 95  sleep 0.5
 96  echo "Downloading and installing Filebrowser..."
 97  sleep 0.5
 98  
 99  curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
100  
101  sleep 0.5
102  echo "Copying configuration file to /etc/filebrowser.json ..."
103  sleep 0.5
104  
105  cp filebrowser.json /etc/filebrowser.json
106  
107  echo "Copying service file to /etc/systemd/system/filebrowser.service ..."
108  sleep 0.5
109  
110  cp filebrowser.service /etc/systemd/system/filebrowser.service
111  
112  echo "Enabling and starting the Filebrowser service..."
113  sleep 0.5
114  
115  systemctl enable filebrowser.service
116  systemctl start filebrowser.service
117  
118  sleep 0.5
119  
120  echo "DONE! Filebrowser is now running!"
121  sleep 0.5
122  echo "After changes to /etc/filebrowser.json, run:"
123  echo "systemctl restart filebrowser.service"
124  
125  echo "Default login:"
126  echo "User: admin"
127  echo "Password: admin"
128  echo "Please change the password after the first login!"</code></pre>
129                    </div>
130                 </li>
131                 <li>
132                    <p>Make sure you are logged in as <strong>root</strong>. Then execute the script with the following command:</p>
133                    <blockquote>
134                       bash example.sh
135                    </blockquote>
136                 </li>
137              </ol>
138              <p>You can now access Filebrowser via the IP address and port in your web browser.</p>
139              <p><strong>Default login:</strong></p>
140              <ul>
141                 <li>User: <strong>admin</strong></li>
142                 <li>Password: <strong>admin</strong></li>
143              </ul>
144              <p>Please change the password after the first login!</p>
145           </section>
146           <footer class="post-footer">
147              <a href="/wiki/tutorials/tutorials.html" class="cta-button">← Back</a>
148           </footer>
149        </main>
150     </body>
151  </html>