E2B Practical Defaults and Best Practices
mainWhen working with E2B sandboxes, follow these recommended defaults:
- Template: Use the
basetemplate unless a specific requirement dictates otherwise. - Shell Execution: Prefer
bash -lcfor executing multi-command strings via the CLI or SDK to ensure the environment is correctly loaded. - File Storage: Store temporary files in
/tmpor the current working directory within the sandbox. - Code Execution: For workloads specifically requiring code execution (e.g.,
run_codeorrunCode), use the Code Interpreter SDK instead of standard sandbox commands.