LocalTube is a high-performance, self-hosted streaming server solution built exclusively for YouTube. By bundling a lightweight, concurrent Java HTTP server inside an Android application (localServerApp), LocalTube enables you to browse, search, and stream YouTube videos and Shorts directly from any device in your local network using a standard web browser—with absolute privacy.
LocalTube transforms your Android device into a private, self-hosted YouTube streaming web server.
- Decentralized Local Server: Runs a lightweight, concurrent Java HTTP server directly on your Android device (default port
8080), serving a modern, responsive web interface. - Cross-Device Playback: Connect seamlessly to the server from any device on your local network (Smart TV, PC, laptop, tablet) by visiting your device's local IP (e.g.,
http://192.168.1.100:8080). - Video.js Media Player Integration: High-performance, customizable HTML5 media player using Video.js for responsive playback controls, adaptive quality switching, and speed adjustment.
- Pre-Built Native Audio Player: Dedicated, high-performance native audio player screen for background music, resolving direct streams natively for optimal battery efficiency.
- Default to Audio-Only Toggle: Set preferences to automatically default playback to Audio-Only mode (Shorts excluded) on a client-specific basis.
- Swipe-to-Refresh Support: Integrated SwipeRefreshLayout inside the Android WebView to reload pages seamlessly on a swipe down gesture.
- Dedicated Vertical Shorts Player: Experience YouTube Shorts in a customized vertical scrollable player, featuring full swipe gesture support.
- Smart Link Routing: Automatically routes Shorts clicked from Watch Later, History, or Search feeds straight to the dedicated Shorts player, loading the selected video first.
- YouTube Interests Importer: Securely log into YouTube via WebView to scrape homepage recommended videos and automatically extract unique tags to build a personalized feed interests keyword list.
- Cross-Device Remote Control: Control active playback clients on your local network (play, pause, seek) directly from the server interface.
- Database Backup (Import/Export): Export and restore your SQLite database settings, personalized interests, and watch history as simple JSON backups.
- Private Watch History & Settings: Tracks your watch history locally using a secure SQLite database (
HistoryDbHelper), maintaining absolute privacy with zero external tracking, ads, or telemetry.
| Server Control (Main) | Server Settings | Touchpad Remote |
|---|---|---|
![]() |
![]() |
![]() |
| Home (Dark Theme) | Home (Light Theme) | Web Player & Details |
|---|---|---|
![]() |
![]() |
![]() |
| Mobile Web Home | Mobile Web Player |
|---|---|
![]() |
![]() |
To compile and launch the local server application:
-
Build and install the application on your Android device:
./gradlew :localServerApp:installDebug
Alternatively, open this repository in Android Studio and run the
:localServerApprun configuration. -
Run the Server:
- Open the LocalTube app on your device.
- Tap Start Server to activate the foreground service. A persistent notification will display your active local network URL.
- Access
http://localhost:8080(orhttp://<your-device-ip>:8080) from any browser on the same network.
This project is dedicated exclusively to:
- YouTube (Videos, Shorts, and Subscriptions)
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
If you would like to support the developer:







