Ubuntu Setup FCM

Create a new project
Give your project a name
Click [Continue]
Give this project a name in Google Analytics. Choose your desired region.
Project successfully created
Add a web app
Give your web app a name
Get the sample from Github
Choose cloud messaging for web
We will need the folder contents of messaging
Lets resume to step #3
sudo apt update
sudo apt upgrade -y
sudo apt install -y npm
sudo npm install -g firebase-tools
Login to Firebase after successfully installing Firebase tools
Run “firebase login” in tmux if you’re running Ubuntu server like me
Login with your Google account
Click [Allow]
Copy the URL
Use a different tmux session, curl the copied URL. Remember to add single quote before and after the URL.
Login successful.
Choose hosting
Choose the project created earlier
cd /tmp
git clone https://github.com/firebase/quickstart-js.git
cd quickstart-js/messaging
cp * ~/oofnivek-medium-fcm/
Lastly deploy it to Firebase hosting
After clicking [Allow], this is the FCM registration token. Copy it.
Click [Send test message]
Paste the FCM registration token here
Successfully received the push notification



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin FOO

Kevin FOO


A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.