Create a file sharing server with Ngrok

Create a file sharing server with Ngrok

About

Ngrok is a CLI (Command Line Interface) tool that allows you to create a secure tunnel, behind NATs and Firewalls, that expose local services to the Internet, all this easily and securely.

Ngrok is cross-platform, so they can be installed on Linux, MacOS, or Windows.

Context

You can share folders on your computer with other people or devices using third party software, online sharing drive (like google drive), features of your operating system and many others.

The option I want to show you is a very simple way to share a folder from your computer. This is not the safest way to do this, so enjoy in moderation. OK?

Now let's create our file sharing server.

Prepare the environment

Não foi fornecido texto alternativo para esta imagem

Hands-on

1. Open your terminal

Não foi fornecido texto alternativo para esta imagem

2. Check if the Ngrok is installed on your computer

ngrok --version
        
Não foi fornecido texto alternativo para esta imagem

3. Authenticate your Ngrok agent with the auth token copied earlier


ngrok config add-authtoken YOUR_COPIED_TOKEN_HERE
        
Não foi fornecido texto alternativo para esta imagem

4. Check if Ngrok has been configured


ngrok config check
        
Não foi fornecido texto alternativo para esta imagem

5. Create and access shared folder and add the files in it


mkdir shared && cd shared
        
Não foi fornecido texto alternativo para esta imagem

6. Share the created shared folder on your computer using Ngrok

On Windows


ngrok http "file:///C:\Users\elielsousa\shared"
        

On Linux and MacOS


ngrok http "file:///Users/elielsousa/shared"
        
Não foi fornecido texto alternativo para esta imagem
Não foi fornecido texto alternativo para esta imagem

7. Open your browser and check if the Ngrok Inspect Service is up

Não foi fornecido texto alternativo para esta imagem

8. Click on the displayed URL and access your files on the internet

  • Use this URL on other devices like your mobile

Não foi fornecido texto alternativo para esta imagem
Não foi fornecido texto alternativo para esta imagem

Conclusion

Using Ngrok it was possible to share your files and folders quickly and simply. Try using other Ngrok features like adding basic authentication to your URL. To the next.

To view or add a comment, sign in

Others also viewed

Explore content categories