# Compile > This document mainly describes how to compile TuGraph from source code. ## 1.Prerequisites It is recommended to build TuGraph on a Linux system. Meanwhile, Docker is a good choice. If you want to set up a new environment, please refer to [Dockerfile](3.docker-deployment.md)。 ## 2.compile Here are steps to compile TuGraph: 1. run `deps/build_deps.sh` to build tugraph-web if you need. Skip this step otherwise. 2. `cmake .. -DOURSYSTEM=centos` or `cmake .. -DOURSYSTEM=ubuntu` 3. If compiling on an arm machine (such as a Mac with M1 chip), add `-DENABLE_BUILD_ON_AARCH64=ON` 4. `make` 5. `make package` or `cpack --config CPackConfig.cmake` Example: `tugraph/tugraph-compile-centos7`Docker environment ```bash $ git clone --recursive https://github.com/TuGraph-family/tugraph-db.git $ cd tugraph-db $ deps/build_deps.sh $ mkdir build && cd build $ cmake .. -DOURSYSTEM=centos7 $ make $ make package ```