The best open source alternative to MyFitnessPal is OpenNutriTracker. If that doesn't suit you, our users have ranked more than 100 alternatives to MyFitnessPal and many of them is open source so hopefully you can find a suitable replacement. Other interesting open source alternatives to MyFitnessPal are FoodYou, OpenTracks, Waistline and FitoTrack.
MyFitnessPal alternatives are mainly Nutrition Trackers, but if you're looking for
Run Trackers or Fitness Trackers you can filter on that. Other popular filters include
Open Source and
Free. You can also filter by region, for example
EU-based alternatives if you prefer software developed in the European Union. These are just examples - use the filter bar below to find more specific alternatives to MyFitnessPal.
The ability to add custom food entries and set custom (daily) nutritional goals absolutely makes this worth using over other, freemium nutrition trackers as these features are usually locked behind expensive, recurring paywalls. The only downsides is units seem to be metric only, at least for weight (kg), and unable to macro/micronutrients on a daily basis, but they are aggregated on a line/bar graph, so you can at least view the data, if in a non-numerical way.