Making it yourself is the way to go. I regularly cook up a larger batch and freeze it in portions - it keeps fine for several months that way. In the fridge itself I'd count on a week max, but honestly, why not just freeze it right away? You only need vegetable scraps (carrots, celery, onions, leeks if necessary), a bit of water, and salt to taste. Let it simmer for two or three hours, strain it, done. Flavor-wise it's worlds apart from the cubes - much rounder, more natural.
The effort is manageable if you do it regularly. Some people also freeze raw vegetable scraps in a container and then cook a bigger batch all at once when enough has accumulated. That saves you energy too. Just try it a few times to see how intense you want the broth to be - some like it stronger, some prefer it more subtle. With the cubes you never get that kind of control.