Using Firebase And Node JS 14 In Docker Ubuntu

Posted by : on

Category : nodejs   firebase   docker   ubuntu


I tried using firebase from my mac mini and it didn’t work, so i decided to use docker, because i need ubuntu to run firebase cli, but the problem is firebase will give you link to authorize, i cant do that with the original ubuntu docker, i need to make my own image, so here is how i did that

1. Prepare the dockerfile

Make a dockerfile

then build the image with the following command

docker build --tag ubuntu-firebase:latest

2. Run the container

Go to your firebase project folder and run the following command to start the docker container we just created

docker run -it -v "$(pwd)":/data1 -p 9005:9005 ubuntu-firebase:latest

3. Using Firebase CLI

As always, you need to login before you can start using firebase cli

firebase login

Dont forget to go to your project folder(data1)

cd data1

Type the following command to activate your firebase project

firebase use --add

4. Enjoy the Firebase CLI

That’s it, now you can do whatever you want with the firebase project, for me i want to use my firebase functions, so first i go to functions folder and install the necessary package

npm install

After that, i go back and test the functions locally

firebase serve --only functions -o 0.0.0.0 --port=9005

I hope that helps you guys, have a nice day!


About Anhar Tasman
Anhar Tasman

Full Stack Developer

Email : tasmananhar@gmail.com

Website :

About Anhar Tasman

With over 5 years of experience in programming, I have successfully developed mobile and web applications for a variety of clients. In my most recent role as Senior Programmer, I have consistently delivered high-quality work, resulting in a 20% increase in client satisfaction within 6 months. Available for new projects in 2 weeks.

Useful Links