# Does dfx deploy frontend also deploy backend dependencies?

**URL:** <https://forum.dfinity.org/t/does-dfx-deploy-frontend-also-deploy-backend-dependencies/62283>\
**Category:** Language Support\
**Created:** [January 7, 2026, 12:15pm UTC](https://forum.dfinity.org/t/does-dfx-deploy-frontend-also-deploy-backend-dependencies/62283 "2026-01-07T12:15:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakepeg](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jakepeg/32/2471_2.png) [@jakepeg](https://forum.dfinity.org/u/jakepeg)\
**Post date:** [January 7, 2026, 12:15pm UTC](https://forum.dfinity.org/t/does-dfx-deploy-frontend-also-deploy-backend-dependencies/62283/1 "2026-01-07T12:15:39Z")

</div>

I noticed a 762B cycles drop after running `dfx deploy frontend --network ic`. The backend module hash changed too, but I only deployed the frontend.

My dfx.json has:

“frontend”: {  
“dependencies”: [“backend”],  
…  
}

Is dfx automatically redeploying the backend because of this dependency?

Can I safely remove backend from frontend dependencies if the canister IDs are already in canister\_ids.json? Or is there a flag to skip dependency deploys?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 7, 2026, 12:24pm UTC](https://forum.dfinity.org/t/does-dfx-deploy-frontend-also-deploy-backend-dependencies/62283/2 "2026-01-07T12:24:13Z")

</div>

Yes, `dfx deploy` is written with the philosophy of doing more work in case of any doubt such that things most likely ‘just work’. In this case the reasoning would be along the lines of “the frontend depends on the backend, so let’s make sure the backend is also up to date”. I’m torn myself on whether or not I like this behavior.

> [@jakepeg](#):
>
> Can I safely remove backend from frontend dependencies if the canister IDs are already in canister\_ids.json?

The way dfx is written today this should be safe. In previous versions this would likely have broken the frontend build.

> [@jakepeg](#):
>
> Or is there a flag to skip dependency deploys?

There is no flag on `dfx deploy`. But if you use the lower level `dfx build|canister` commands then only what you ask for happens. If you want to emulate `dfx deploy` but without touching dependencies, then you want to do `dfx canister create && dfx build && dfx canister install`

---

<div class="post-metadata">

**Author:** ![jakepeg](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jakepeg/32/2471_2.png) [@jakepeg](https://forum.dfinity.org/u/jakepeg)\
**Post date:** [January 7, 2026, 1:09pm UTC](https://forum.dfinity.org/t/does-dfx-deploy-frontend-also-deploy-backend-dependencies/62283/3 "2026-01-07T13:09:46Z")

</div>

Great thanks Vivienne. I removed the dep from dfx.json, tested and it worked fine
