I want to set freecodecamp in my own machine while the mongodb database will be on the cloud (maybe atlas account).
can it be done? and if so then how?
All of freeCodeCamp is open source (GitHub - freeCodeCamp/freeCodeCamp: freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.) so you can run your own instance if you like, but it is not packaged for easy self-hosting and figuring out how to run your own instance requires a fair amount of technical experience.