Skip to content

Turn your laptop or desktop into a personal local cloud to easily share files with other devices on the same Wi-Fi network.

License

Notifications You must be signed in to change notification settings

yusufshakeel/localbox

Repository files navigation

localbox

license Static Badge

Turn your laptop or desktop into a personal local cloud to easily share files with other devices on the same Wi-Fi network.

Features:

  • Personal Drive with configurable storage limit per user
  • File upload and sharing
  • Temporary Chats (TempChats)
  • Audio/Video player
  • User management (Authentication and Authorization)
  • Dark Mode

Building blocks:

Home

img-v0.9.1.png

Personal Drive

personal-drive.png

Admin Dashboard

admin-dashboard-v0.11.0.png

Table of Content

Use Case

Imagine you’re at home or in an office:

  • You can quickly share files like photos, documents, or videos between your phone and computer without using cloud services (e.g., Google Drive or Dropbox).
  • Any device on the same Wi-Fi network can interact with the Local Box to upload files or retrieve hosted files.

Server Clients

The computer that is running this application will act like the server. A local IP address (like 192.168.0.151) will be displayed. Clients (other users) can connect to that IP address via browsers.

Make sure to add port number to the url.

If the server IP is 192.168.0.151 and is running at port 3001 then type http://192.168.0.151:3001 in the browser.

Minimum requirements

Software:

  • Node.js (version 16 or higher)
  • npm
  • npx

Hardware:

  • Any modern/older laptop or desktop should work.

My setup:

  • Laptop: HP ProBook 6450b
  • Year: 2010
  • Storage: 320GB HDD
  • Memory: 4GB
  • OS: Ubuntu 20.04LTS

Getting Started

Clone

  • Clone this repository from GitHub.
git clone https://github.com/yusufshakeel/localbox.git

Install dependencies

  • Go inside the cloned directory and install the dependencies
npm i

Bootstrap

  • Now, run the following command in the terminal to bootstrap the project.

This will create files and folders that are needed by the application.

npm run bootstrap

Build

  • Now, build the application by running the following command in the terminal.

This will build the application.

npm run build

Start the server

  • You are now ready to start your localbox server.
npm run start

Alternatively, run the following command if you want to run the application in dev mode.

npm run dev
  • You will see the url of the localbox application in the terminal after it starts running.

  • Open the url (example http://localhost:3000) in the browser.

Use port

Run the following command to run the application on another port.

PORT=9000 npm run start

First time setup

  • Go to Home page, and you will see localbox perform some setup operations.
  • You will also get the admin account created.
  • A setup.lock file will be created inside the /private folder.

Default credentials

Username: admin
Password: root1234

Change the password of the admin account after logging in.

Important! Make sure to restart the server.

Rerun setup

  • Delete the setup.lock file from the /private folder.
  • Run the server npm run start or npm run dev
  • Open the Home page.
  • Setup will be performed again.
  • Important! Make sure to restart the server.

When to rerun the setup?

  • When pulling the latest code from the main branch from GitHub.
  • When you re-install the npm packages by running the npm i command.
  • When you re-bootstrap.

Reset Admin Password

Go to /private folder and look for reset-admin-password.txt file. Enter the new password like the following and save the file.

NEW_PASSWORD=myNewAdminPassword

Points to note:

  • Make sure to write the password after the = sign.
  • Do not add space before/after the password.
  • Keep the password within one line.
  • Password length must be between 8 and 32 characters.

Now, go to the home page and the admin password will be updated. Change the Admin password after logging in.

Get Updates

Pull the latest main branch changes to your local main branch.

git pull origin main

If you are pulling a newer version then run the install dependencies, bootstrap, build and the rerun setup steps again.

Folders

private

This directory contains private files. Don't change anything here.

public

This directory contains files and folders that can be viewed in browser when you are running localbox.

License

It's free 😃

MIT License Copyright (c) 2024 Yusuf Shakeel

Donate

Feeling generous 😃 Donate via PayPal

About

Turn your laptop or desktop into a personal local cloud to easily share files with other devices on the same Wi-Fi network.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages