home

Spin Up a File Server Instantly

2026.05.26 4 min read
CLIDev toolsWeb

Ever needed to fling a file from your laptop to your phone, or preview a quick HTML/CSS mockup without fighting CORS? You don’t need Nginx, Apache, or a Node backend for that. Almost every language ships a built-in file server — one line, zero config.

পিসি থেকে ফোনে একটা ফাইল ঝটপট পাঠানো, কিংবা ছোট একটা HTML/CSS মকআপ CORS-এর ঝামেলা ছাড়াই ব্রাউজারে দেখা — এসবের জন্য Nginx, Apache বা Node ব্যাকএন্ড লাগে না। প্রায় সব ল্যাঙ্গুয়েজেই বিল্ট-ইন ফাইল সার্ভার আছে — এক লাইন, কোনো কনফিগ ছাড়াই।

Spinning up a full web stack just to share one file is using a sledgehammer to crack a nut.
একটা ফাইল শেয়ার করতে গিয়ে আস্ত একটা ওয়েব স্ট্যাক দাঁড় করানো মানে মশা মারতে কামান দাগানো।

Python 3 — the universal savior

Installed on practically every Mac and Linux box by default. The undisputed king of the quick file server.

ম্যাক বা লিনাক্সে সাধারণত বিল্ট-ইন থাকেই — এই কাজের জন্য পাইথন একদম ওস্তাদ।

terminal
python -m http.server 8080

Still stuck in 2015 on Python 2? The command is python -m SimpleHTTPServer 8080.

এখনো পুরনো পাইথন ২ ব্যবহার করলে কমান্ডটি হবে python -m SimpleHTTPServer 8080

PHP — old reliable

People love to hate on PHP, but its CLI has shipped a fast, built-in web server for years.

পিএইচপি নিয়ে অনেকে ট্রোল করলেও এর CLI-তে দারুণ একটা ওয়েব সার্ভার ডিফল্টভাবেই দেওয়া থাকে।

terminal
php -S localhost:8080

Ruby — the sleek alternative

No gems to install. Ruby’s neat built-in un library handles this beautifully.

কোনো এক্সট্রা জেম (Gem) ইন্সটল করার দরকার নেই — রুবির বিল্ট-ইন un লাইব্রেরিই কাজটা সুন্দর করে দেয়।

terminal
ruby -run -e httpd . -p 8080

Node.js — via npx

Node’s core binary has no flag to serve files, but npx (bundled with Node) runs one without installing anything.

নোডের কোর বাইনারিতে ফাইল সার্ভ করার ফ্ল্যাগ নেই, কিন্তু নোডের সাথে আসা npx কিছু গ্লোবালি ইন্সটল না করেই এক লাইনে সার্ভার চালায়।

terminal
npx http-server -p 8080

npx serve works just as well — and looks a bit prettier.

চাইলে npx serve কমান্ডটিও ব্যবহার করতে পারেন, এটিও একই কাজ করে।

BusyBox — the lightweight ninja

Inside a stripped-down Docker container or an embedded Linux system, BusyBox is usually your only friend. It bakes in a tiny HTTP daemon.

মিনিমাল ডকার কন্টেইনার বা এমবেডেড লিনাক্সে, যেখানে ভারী কিছু নেই, সেখানে বিজিবক্সই একমাত্র ভরসা। এতে ছোট্ট একটা HTTP ডিমন বিল্ট-ইন থাকে।

terminal
busybox httpd -f -p 8080

The cheat sheet

Language / ToolThe magic commandWhy it’s great
Python 3python -m http.server 8080Ubiquitous, zero setup.
PHPphp -S localhost:8080Super fast for web devs.
Rubyruby -run -e httpd . -p 8080Clean and built-in.
Node.jsnpx http-server -p 8080Great for frontend testing.
BusyBoxbusybox httpd -f -p 8080Perfect for tiny Linux.
ল্যাঙ্গুয়েজ / টুলজাদুকরী কমান্ডকেন ব্যবহার করবেন
Python 3python -m http.server 8080সব জায়গায় থাকে, বাড়তি ঝামেলা নেই।
PHPphp -S localhost:8080ওয়েব ডেভেলপারদের জন্য সুপার ফাস্ট।
Rubyruby -run -e httpd . -p 8080রুবির নিজস্ব বিল্ট-ইন লাইব্রেরি।
Node.jsnpx http-server -p 8080মডার্ন ফ্রন্টএন্ড টেস্টের জন্য বেস্ট।
BusyBoxbusybox httpd -f -p 8080ছোটখাটো বা ডকার লিনাক্সের জন্য সেরা।
heads up

For the love of cybersecurity, don’t run these in production — no rate limiting, no hardening, no optimization. For local hacking and quick file sharing, though, they’re absolute lifesavers.

সতর্কবার্তা

দয়া করে এগুলো প্রোডাকশন সার্ভারে চালাবেন না — কোনো সিকিউরিটি লেয়ার বা রেট লিমিটিং নেই। তবে লোকাল ডেভেলপমেন্ট আর ফাইল শেয়ারিংয়ের জন্য এগুলো লাইফসেভার!

— H, writing from Sylhet. Now go serve a folder.

get the next one → / RSS