- Install the Truffle package globally using npm. You might want to use the sudo command as follows if you face any permissions issues:
npm install -g truffle
- Once the package is installed, you can access it through the command line. Create an empty truffle_project folder for your Truffle project using the following command:
mkdir truffle_projectcd truffle_project
- Use the init command to initialize your project with the default contracts and migrations:
truffle init
- The preceding command will create a basic template that you can use to start your project. The template will have the following file structure:
- ./contracts to store your Solidity smart contract files
- ./tests to store smart contracts and application test scripts ...